At 11:39 PM 3/18/2011, Manatee wrote:
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.

No help, really, but copy-n-paste of the below ran fine first time on 2.7 install on Win7. Maybe accidental special characters in source file? How about you also try copy-n-paste from your email? Who knows.... :-)

# File: hello2.py

from Tkinter import *

class App:

    def __init__(self, master):

        frame = Frame(master)
        frame.pack()

        self.button = Button(frame, text="QUIT", fg="red",
command=frame.quit)
        self.button.pack(side=LEFT)

        self.hi_there = Button(frame, text="Hello",
command=self.say_hi)
        self.hi_there.pack(side=LEFT)

    def say_hi(self):

        print "hi there, everyone"

root = Tk()

app = App(root)

root.mainloop()
--
http://mail.python.org/mailman/listinfo/python-list

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to