我是python的新手,现在我正熟悉命令提示符。我试图在我的根结构(/ python)的文件夹(/ asmt-01)中打开counting.py文件。我通过notepad ++测试了我的python,它运行正常。但是,我不能单独通过命令提示符运行此脚本。我有以下脚本。我究竟做错了什么?另外,有没有资源可以帮助我理解python用户的命令提示符?我感谢任何建议和帮助,谢谢。
C:\Users\Maria\Desktop\python>dir
Directory of C:\Users\Maria\Desktop\python
09/09/2013 12:23 AM <DIR> .
09/09/2013 12:23 AM <DIR> ..
09/08/2013 09:42 PM <DIR> asmt-01
09/08/2013 08:35 PM 19 firstprog.py
1 File(s) 19 bytes
3 Dir(s) 605,589,807,104 bytes free
C:\Users\Maria\Desktop\python>dir asmt-01
Directory of C:\Users\Maria\Desktop\python\asmt-01
09/08/2013 09:42 PM <DIR> .
09/08/2013 09:42 PM <DIR> ..
09/08/2013 09:57 PM 37 counting.py
1 File(s) 37 bytes
2 Dir(s) 605,589,577,728 bytes free
C:\Users\Maria\Desktop\python>python counting.py
python: can't open file 'counting.py': [Errno 2] No such file or directory
C:\Users\Maria\Desktop\python>
答案 0 :(得分:4)
使用C:\Users\Maria\Desktop\python>python asmt-01\counting.py
您可以在http://www.cs.princeton.edu/courses/archive/spr05/cos126/cmd-prompt.html
了解有关Windows命令提示的详情