37,719
社区成员
发帖
与我相关
我的任务
分享
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> the_file = open("D:\\Program Files\\Python\\test.txt");
>>> print the_file
<open file 'D:\Program Files\Python\test.txt', mode 'r' at 0x0000000002FAA270>
>>> notExist_file = open("D:\\Program Files\\Python\\notFound.txt");
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
notExist_file = open("D:\\Program Files\\Python\\notFound.txt");
IOError: [Errno 2] No such file or directory: 'D:\\Program Files\\Python\\notFound.txt'
>>>
所以:
1.猜测你的python是不是安装的有问题。
重新安装一下试试。
2.你的python是什么版本的???