Problem using StringVar()

Chris Roy-Smith <[email protected]>
Newsgroups gmane.comp.python.tkinter
Message-ID <[email protected]>
Just trying to learn to use Tkinter.

python 2.7.3  OS Ubuntu 12.4

This code
-----------------------
#!/usr/bin/python
import Tkinter
top = Tkinter.Tk()

v = top.StringVar()
Label(master, textvariable=v).pack()

v.set("hello")

top.mainloop()
---------------------------
returns this error message

Traceback (most recent call last):
   File "./hello.py", line 5, in <module>
     v = top.StringVar()
   File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1767, in __getattr__
     return getattr(self.tk, attr)
AttributeError: StringVar


Please what am I doing wrong?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.