Can not find a file in CMD model python when everything is OK in IDLE

Sullivan WxPyQtKinter sullivanz.pku at
Sat Mar 11 11:17:06 CET 2006

I use python in Windows XP platform. I find that if I write a .py file
in a directory, such as windows desktop, in which a file named
'ticket.txt' is located:


In IDLE, this py file work all right. But if I launch python
interpretor in the command shell like this:

C:\Documents and Settings\Xiaozhong Zheng>python "C:\Documents and
zhong Zheng\Desktop\"

The interpretor would not find the file.

Traceback (most recent call last):
  File "C:\Documents and Settings\Xiaozhong Zheng\Desktop\", line
1, in ?
IOError: [Errno 2] No such file or directory: 'ticket.txt'

Anyone knows why?

In addition, if I start IIS web service that runs .py file as CGI
program, then this .py file also works.

More information about the Python-list mailing list