粉丝1.5万获赞14.9万


文件夹中有很多个 ts 后缀的视频文件,要合并成一个视频文件。在 check gpt 中可以这样输入提示词,你是一个拍放编程专家,要完成一个批量合并 ts 文件的任务。具体步骤如下,打开文件夹 c user style pictures camera row index f e v e e e 二零二三零八二五二二一四零八 part 零按照文件名称的顺序,将文件家中所有 t s 后缀的文件合并成一个文件。合并完成后,删除合并前的所有 t s 文件,只保留合并后的 t s 文件。 注意,每一步都要输出相关信息。 chat gpt 生成代码如下, import us 定义文件加路径 mode path arc user style pictures, camera roll index f e v e a 一二零二三零八二五二二幺四零八 part 零分检查文件夹是否存在 if not us pad exists folder pad print f 文件夹 folder pads 不存在 exit 获取文件家中所有的 t s 文件,并按文件名排序 t s files 等于 for finis list dear hold a path if thanks with t s t s files soar 如果没有 t s 文件,则无需合并。 if not t s files friend。 文件夹中没有 t s 文件,需要合并 exit 创建要保存合并内容的文件。 output file pad as path join folder path merge t s with open output file path w w s output file four t s file in t s files t s file path as path join fold path t s file with open t s file path r b s input file data input file read output file right data print f 已合并文件 t s file 删除原始 t s 文件。 for t s file in t s files ts file pad as pad join hold pat ts file us remove ts file pat printf 已删除文件 ts file printf 合并完成,合并后的文件保存在 output file pad 运行程序成功合并。

