Tk variables problem

Fredrik Lundh effbot at telia.com
Wed Feb 2 17:20:56 CET 2000


<F note="mailed and posted">

Sven Drescher wrote:
> I cannot understand why the following little program doesn't work correct.
> It's surely a little problem, but in my program are more situations, where
> such an error is raised.
/.../
> Attribute Error: 'None' object has no attribute 'tk'

you must create a Tk instance (a root window)
before you can create variables.  creating such
a window initializes the Tk interface, and installs
a default root object.

(if you create a widget, it automagically creates
a root window for you, but image and variable
objects doesn't do that)

</F>

<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list