Syntax Error

Vlastimil Brom vlastimil.brom at gmail.com
Sat Mar 19 01:03:24 EDT 2011


2011/3/19 Manatee <markrrivet at aol.com>:
> I hope this is the place to post this question. I am a really new
> pythonista. I am studying Tkinter and when I run this basic code, I
> get  a syntax error on line 20,  print "hi there, everyone". Its a
> simple print line, but I can't see the problem. I am using Python
> 2.71, gVim for an editor, and a console window to execute the program.
> Here is the link to the website that I am trying to follow:
>
> http://www.pythonware.com/library/tkinter/introduction/hello-again.htm
>
> Thanks for any help.
>
> [...]

Hi,
the code on the mentioned page as well as yours (with adapted
indentation and wordwrapping from the mail) seems ok for python 2.

Is it possible, that you are actually using python3?
This would give something like
    print "hi there, everyone!"
                              ^
SyntaxError: invalid syntax

as print was changed to a funcion in this version.
print("hi there, everyone!")

hth,
 vbr



More information about the Python-list mailing list