Terminal on Mac, Error


I have recently purchased, “Learn Python 2 the hard way” and I have run into an error with my terminal before even being able to get started. It’s saying command not found after I try and run Ex.1 even when I run via sudo. I’ll post an image here as well.

It looks like you are in your root directory. In order to run the script, you need to change directory (cd) to the location of where you saved ex1.py before running the script. Assuming you are in root and pystuff is a folder a layer down…

cd pystuff

Then run the script from there…

python ex1.py

Thank you, sir. It worked.

A free service run by Zed A. Shaw for learncodethehardway.org.