代码如下 import os target_dir = './caption-out-1/' print(f' delete directory: {target_dir}') shutil.rmtree(target_dir) os.mkdir(target_dir)