Python 3.5 shutil Copy example

来源:互联网 发布:linux php.ini 编辑:程序博客网 时间:2024/06/09 18:14
#!/usr/bin/env python  # coding=utf-8  import osimport shutilimport tempfile#拷文件shutil.copy("E:/HI.1.1/test_py/hi.txt", "E:/HI.1.1/test_py/hi.txt.t") # if os.path.isfile (filename2): print ("Success") # dirname1 = tempfile.mktemp (".dir")# os.mkdir (dirname1)# dirname2 = dirname1 + ".copy"# print (dirname1, "=>", dirname2)  # if os.path.isdir (dirname2): print "Success"


 python --version
Python 3.5.2
文件Copy命令 目标文件已存在会覆
Mark



0 0
原创粉丝点击