我在sublime和editplus里写python,如下几句:
import shutil
shutil.copyfile('hello.txt', 'hello2.txt')
提示错误:
Traceback (most recent call last):
File "F:\Python\exercise\文件处理\shutil.py", line 2, in
import shutil
File "F:\Python\exercise\文件处理\shutil.py", line 3, in
shutil.copyfile('hello.txt', 'hello2.txt')
AttributeError: 'module' object has no attribute 'copyfile'
[Finished in 0.6s]
http://blog.csdn.net/business122/article/details/7599446
你的程序名也叫shutil,换个名字,不然和库重名了。