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
上一篇 下一篇

猜你喜欢

热点阅读