On Sep 26, 2010, at 6:06 PM, Marc Tompkins wrote:
On Sun, Sep 26, 2010 at 2:55 PM, Bill DeBroglie <bill.debrog...@gmail.com
> wrote:
Which is great, but when I try and run the same code in the Terminal
by calling a program I've written (print("hello world") again) I get
the following:
matthews-macbook:Dawson_Book matthewparrilla$ ./chapter_2.py
./chapter_2.py: line 4: syntax error near unexpected token
`"Hello World"'
./chapter_2.py: line 4: `print("Hello World")'
I'm using a Mac OS X 10.5.8. I had previously downloaded Python
2.6.5 AND 3.1 and had them both on this computer simultaneously but
was having trouble with 3.1 crashing. I have since put both in the
trash but obviously still have 2.6.5 on my system, I assume that was
the version pre-installed on this Mac.
I think that's a shell issue, not specifically a Python issue. You
need to include a line at the top of the script to tell the OS how
to find the Python interpreter. Try adding this line at the
beginning:
#!/usr/bin/env python
Is this what you mean?
matthew-parrillas-macbook:Dawson_Book matthewparrilla$ #!/usr/bin/env
python
matthew-parrillas-macbook:Dawson_Book matthewparrilla$ ./chapter_2.py
./chapter_2.py: line 1: syntax error near unexpected token `"Hello
World"'
./chapter_2.py: line 1: `print("Hello World")'
If so, obviously still no dice.
Your default Python install probably is NOT installed at /usr/bin/
python, but there should be a symbolic link there that points to the
actual location. If not, you'll need to adjust things a bit.
--
www.fsrtechnologies.com
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor