1

I am using Zed Shaw's "Learn Python the Hard Way" and have gotten Python to work. I made a file and saved it as ex1.py. I type the command

python ex1.py

This does not recognize the file like it should and instead gives me this

can't open file 'ex1.py': [Errno 2] No such file or directory

I have checked and double-checked it. There is definitely a ex1.py file saved in my Local Disk (C:). None of the common errors on his tutorial include mine. Any tips?

Eric Dand
  • 1,106
  • 13
  • 37

2 Answers2

0

You need to explicitly indicate that the file is in the current working directory.

Try this:

python ./ex1.py
David
  • 6,462
  • 2
  • 25
  • 22
0

I got it to work finally, I had it in a folder under the path

C:\Users\MyUser\PythonTest\ex1.py

This was wrong, however when I made it

C:\Users\MyUser\ex1.py

It worked, thanks for all the help!