好吧,我还有另一个问题。我实施了错误检查,但由于某种原因它仍然无法正常工作。我仍然收到python错误,而不是我刚刚在程序中写的错误。
Traceback (most recent call last): File "E:/python/copyfile.py", line 31, incopyFile() File "E:/python/copyfile.py", line 8, in copyFile file1 = open(source,"r") IOError: [Errno 2] No such file or directory: 'C:/Users/Public/asdf.txt'
Corey Goldbe.. 5
检出shutil
标准库中的模块:
shutil.copyfile(src, dst)
http://docs.python.org/2/library/shutil.html#shutil.copyfile
检出shutil
标准库中的模块:
shutil.copyfile(src, dst)
http://docs.python.org/2/library/shutil.html#shutil.copyfile