From c57b4d749f9dfa3317fd2fcbd3b84c4dcb5e856b Mon Sep 17 00:00:00 2001 From: abc1763613206 Date: Wed, 17 Feb 2021 18:40:07 +0800 Subject: [PATCH] optimize --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.py b/main.py index e3b6f77..62a3278 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,7 @@ import traceback import requests import subprocess import time +import shutil from ffmpy import FFprobe from subprocess import PIPE from sys import stdout @@ -92,6 +93,11 @@ def main(): fulltimes = '-{}{}{}{}{}'.format(dt.year,dt.month,dt.day,dt.hour,dt.minute) # 时间后缀 # times = fulltimes # 有时间后缀 times = '' # 无时间后缀 + # 清空旧文件 + shutil.rmtree('groups') + os.mkdir('groups') + os.remove('merged.txt') + os.remove('merged-simple.txt') with open('data.csv') as f: f_csv = csv.reader(f) headers = next(f_csv)