Simple tkinter query about creating a tk,StringVar() failure

boB Stepp robertvstepp at gmail.com
Sat Feb 6 21:40:16 EST 2016


On Sat, Feb 6, 2016 at 6:38 PM,  <paul.hermeneutic at gmail.com> wrote:
> Why does this interactive instantiation fail when it seems to work
> when run in a script?

You have to establish your root window first:

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900
64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter as tk
>>> root = tk.Tk()    # This will open an empty window.
>>> name = tk.StringVar()
>>>


-- 
boB


More information about the Python-list mailing list