Terminal OS X Error when using Python
Posted
by
Stephen
on Super User
See other posts from Super User
or by Stephen
Published on 2011-02-04T06:22:28Z
Indexed on
2011/02/04
7:28 UTC
Read the original article
Hit count: 493
Hey, I'm trying to learn how to program so I've installed the latest version of Python and I've been following the Byte of Python tutorial. I'm using Textwrangler I've only gotten as far as the simple "Hello World" intro and I'm already having a problem. I type out the code (just without the ""):
"#!/usr/bin/python"
"#Filename: helloworld.py"
"print('Hello World')"
and save it to my desktop as helloworld.py. I then go into terminal and type "python3 helloworld.py" and I get the following error message:
/Library/Frameworks/Python.framework/Versions/3.1/Resources/Python.app/Contents/MacOS/Python: can't open file 'helloworld.py': [Errno 2] No such file or directory
I was hoping someone could tell me what I'm doing wrong. If I choose to run the script from Textwrangler it operates just fine however I'm not able to access it from the Terminal. Thanks so much!
© Super User or respective owner