I wrote program in one text file "program.py".I saved this file on desktop. I want to execute this through command line
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\x0266161>cd C:\Users\x0266161\Desktop\
C:\Users\x0266161\Desktop>python program.py
hello world
Now is it possible for me to execute the program without changing to the directory where program is stored.
when I try I am getting below error
C:\Users\x0266161\Desktop>cd ..
C:\Users\x0266161>cd ..
C:\Users>cd ..
C:\>python program.py
python: can't open file 'program.py': [Errno 2] No such file or directory
C:\>
I have set environmental variable to this path C:\Users\x0266161\Desktop.