I am new to Python and have a very simple problem, but I can’t figure it out.
I created a simple file called Hello.py that basically just prints "Hello".
When I am at my command prompt “c:\python34\scripts>” and I type “python Hello.py”, I get the following error. See attached.
My error message: "c:\python34\python.exe: can't open file 'Hello.py': [Errno 2] No such file or directory”
What could be wrong with my setups? Any help would be greatly appreciated!
Help get this topic noticed by sharing it on Twitter, Facebook, or email.
That error basically means that python can't find the file. The reason is that the python script isn't in the same directory as the python executable.
To fix this, you could move the script to the c:\python34\ folder or, better yet, set the environmental variable for Python, so you can run scripts in any directory on your computer. This page has instructions -
You want the section 3.3.1. Setting environment variable
O'Reilly Customer Service