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

2006-03-11 Thread Sullivan WxPyQtKinter
I see. I once was a VB programmer. In VB, the current directory is always set to where the module locates before it runs. -- http://mail.python.org/mailman/listinfo/python-list

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

2006-03-11 Thread Sullivan WxPyQtKinter
I see. I once was a VB programmer. In VB, the current directory is always set to where the module locates before it runs. -- http://mail.python.org/mailman/listinfo/python-list

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

2006-03-11 Thread Fredrik Lundh
"Sullivan WxPyQtKinter" wrote: > 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 > Settings\Xiaozhong Zheng\Desktop\t.py" > > The interpretor would not find the file.

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

2006-03-11 Thread Sullivan WxPyQtKinter
Sorry, I mistyped the line. In the program it IS: f=open("ticket.txt"), no '\' included. -- http://mail.python.org/mailman/listinfo/python-list

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

2006-03-11 Thread Fredrik Lundh
"Sullivan WxPyQtKinter" wrote: > 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: > > f=open("\ticket.txt") > print f.read() "\t" is a tab character: >>> print '\ticket.txt'

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

2006-03-11 Thread Sullivan WxPyQtKinter
I use python on 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: f=open("ticket.txt") print f.read() In IDLE, this py file work all right. But if I launch python interpretor in the command shell like th

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

2006-03-11 Thread Sullivan WxPyQtKinter
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: f=open("\ticket.txt") print f.read() In IDLE, this py file work all right. But if I launch python interpretor in the command shell like th