KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
(Python version: 3.1.1) I am having a strange problem with StringVar in tkinter. While attempting to continuously keep a Message widget updated in a project, I kept getting an error while trying to create the variable. I jumped out to an interactive python shell to investigate and this is what I got: >>> StringVar <class 'tkinter.StringVar'> >>> StringVar() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python31\lib\tkinter\__init__.py", line 243, in __init__ Variable.__init__(self, master, value, name) File "C:\Python31\lib\tkinter\__init__.py", line 174, in __init__ self._tk = master.tk AttributeError: 'NoneType' object has no attribute 'tk' >>> Any ideas? Every example I have seen on tkinter usage shows initializing the variable with nothing sent to the constructor so I am at a loss if I am missing something...
Tags (comma-separated)
Save Edits
Cancel