Python: 文件夹操作
2018-08-06 本文已影响8人
谢小帅
os
os.remove(file)
os.rmdir(path) # empty folder
shutil
shutil.copyfile(src, dst) # file
shutil.copytree(src, dst) # folder, can be not empty
shutil.rmtree(src, dst) # folder, can be not empty
os.remove(file)
os.rmdir(path) # empty folder
shutil.copyfile(src, dst) # file
shutil.copytree(src, dst) # folder, can be not empty
shutil.rmtree(src, dst) # folder, can be not empty