Maria Gosur
Maria Gosur

Reputation: 101

.py file not opening but runs okay via notepad++

I am new to python and am getting myself familiar with command prompt now. I am trying to open counting.py file within a folder (/asmt-01) of my root structure (/python). I tested my python via notepad++, and it runs okay. However, I cannot get this script to run via the command prompt alone. I have the following script. What am I doing wrong? Also, are there any resources to help me understand the command prompt for python users? I appreciate any advice and help, thank you.

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>

Upvotes: 0

Views: 386

Answers (2)

Aryan Gupta
Aryan Gupta

Reputation: 1

Same problem i had, You should download Python from the Microsoft store, And then try running it a prompt will come to use which app to open this file,select the python that you have installed now (You can either choose Idle or Python cmd)

Upvotes: 0

Brajesh Kumar
Brajesh Kumar

Reputation: 937

Execute using C:\Users\Maria\Desktop\python>python asmt-01\counting.py

You can learn more about windows command prompt here http://www.cs.princeton.edu/courses/archive/spr05/cos126/cmd-prompt.html

Upvotes: 4

Related Questions