[Tutor] Why does "window = tk.Tk()" open a tkinter window when typed in the Python interpreter?
Alan Gauld
alan.gauld at yahoo.co.uk
Sat Aug 29 04:09:58 EDT 2020
On 29/08/2020 03:13, boB Stepp wrote:
>> This may require some examination of the source.
>
> Are you inclined to think the source code of Tcl/Tk is where to look,
I suspect so since the behaviour is the same as for Python.
Tkinter is just a wrapper around Tk so whatever Tk does Tkinter
will do.
> or do you think it is how Python's wrapper, tkinter, implements
> Tcl/Tk is where I should look?
It might need both.
Id suggest asking on the tkinter mailing list. Those guys
will likely know, or at least know where to look!
On gmane its found at:
gmane.comp.python.tkinter
> phrase an effective set of search terms. I did come across that the
> scripting language, Tcl, seems to have its own interpreter mode, so
> your initial comments may be spot on if this was the behavior being
> sought up front by Tcl itself.
Yes, there is a dedicated interpreter for both Tcl (tclsh) and for
Tk (wish). When you run wish it starts up the same blank window you
get with a call to Tk() so I'm guessing that somehow tkinter fires
up wish when in interactive mode. But that is just a guess...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list