Python 小技巧

1 文件拷貝 from shutil import copyfile copyfile(src, dst) 2 文件、文件夾刪除 判斷文件是否存在,存在則刪除python myfile="/tmp/foo.txt" if os.path.isfile(myfile): os.remove(myfile) else: ## Show an error ## print("Error: %s
相關文章
相關標籤/搜索