[Tutor] Issues In Terminal

Bill DeBroglie bill.debroglie at gmail.com
Sun Sep 26 23:55:40 CEST 2010


Hello all,

Totally new to this stuff and community so I very much appreciate the  
help and apologize in advance for asking what might be a stupid  
question... Oh, and I'm new to the lingo too!!

I'm having issues running Python in Terminal. When I run code through  
the interpreter I get:

	Python 2.6.5 (r236:73959, Mar 24 2010, 01:32:55)
	[GCC 4.0.1 (Apple Inc. build 5943)] on darwin
	Type "help", "copyright", "credits" or "license" for more information.
	>>> print("Hello World")
	Hello World

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.

Any guidance at all would be much appreciated-- I'm totally lost and  
have spent hours trying to figure this out.

bdb


More information about the Tutor mailing list