elif ("不满意") in question["question"]: print(video_name) for t in os.listdir("/root/web/source/now_video/"): c_path = os.path.join("/root/web/source/now_video/",t) os.remove(c_path) //删除模块:删除now_video中的视频文件 now_video = t select_video_path = "/root/web/source/select_video/" videos = os.listdir(select_video_path) for video in videos: select_video_name = video break # if "wangbingbing" in select_video_name: videos_ran = [] for video in videos: videos_ran.append(video) video_ran = now_video '''随机加载一个视频''' while(video_ran == now_video): video_ran_list = random.sample(videos_ran,k=1) for i in video_ran_list: video_ran = i video_name = os.path.join("select_video/",video_ran)
时间: 2024-02-14 14:03:47 浏览: 91
bastesting.zip_Linux/Unix编程_LINUX_
这段代码看起来像是一个视频选择模块,当用户对当前视频不满意时,会删除当前视频,并从一个视频库中选择一个新的视频进行播放。其中,视频库的路径为"/root/web/source/select_video/",当前播放的视频路径为"/root/web/source/now_video/"。代码中使用了随机选择的方法,确保每次新选择的视频不与当前播放的视频相同。
阅读全文