Programming in Python

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
amalsaie
 
Posts: 9
Joined: Tue May 07, 2013 2:58 pm

Programming in Python

Post by amalsaie »

I have a problem with the PRINT stamens in python. When I type
>>> print ("Hi there")

I receive error (syntic error) at ".
I thought may be I have to reconfigure the keyboard, I reconfigure to US international the type I use when configurating the keyboard for Linux. For the Linux it work nicely but I. The case of Raspberry Pi what ever selection I tried it always give me syntic. Thus I can not program my Pi.
Regards

User avatar
schnee72
 
Posts: 46
Joined: Fri Sep 04, 2009 7:40 pm

Re: Programming in Python

Post by schnee72 »

Try:

Code: Select all

print "Hi there"

amalsaie
 
Posts: 9
Joined: Tue May 07, 2013 2:58 pm

Re: Programming in Python

Post by amalsaie »

This is what I have done but in the shell command. I would think it will give me the same syntic error in the edit mode
Regards

User avatar
freimer
 
Posts: 4
Joined: Wed Nov 27, 2013 11:35 pm

Re: Programming in Python

Post by freimer »

You are probably running different version of the Python interpreter. In 2.x versions print was a reserved word and did not require the parenthesis. In 3.x it is not a reserved word, and is "just" a function, so it requires the parenthesis.

HTH,

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”