by python immediately after running its pack method howeverbecause tkinter emits tk calls when objects are constructedthe label will be drawn on the display as expectedeven though we haven' held onto the corresponding python object in our script in facttkinter internally cross-links widget objects into long-lived tree used to represent the displayso the label object made during this statement actually is retainedeven if not by our code in other wordsyour scripts don' generally have to care about widget object lifetimesand it' ok to make widgets and pack them immediately in the same statement without maintaining reference to them explicitly in your code but that does not mean that it' ok to say something like thiswidget label(text='hi'pack(use widget wrongthis statement almost seems like it should assign newly packed label to widgetbut it does not do this in factit' really notorious tkinter beginner' mistake the widget pack method packs the widget but does not return the widget thus packed reallypack returns the python object noneafter such statementwidget will be reference to noneand any further widget operations through that name will fail for instancethe following failstoofor the same reasonlabel(text='hi'pack(mainloop(wrongsince pack returns noneasking for its mainloop attribute generates an exception (as it shouldif you really want to both pack widget and retain reference to itsay this insteadwidget label(text='hi'widget pack(use widget ok too this form is bit more verbose but is less tricky than packing widget in the same statement that creates itand it allows you to hold onto the widget for later processing it' probably more common in realistic scripts that perform more complex widget configuration and layouts on the other handscripts that compose layouts often add some widgets once and for all when they are created and never need to reconfigure them laterassigning to longlived names in such programs is pointless and unnecessary ex-tcl programmers in the audience may be interested to know thatat least at the time was writing this footnotepython not only builds the widget tree internallybut uses it to automatically generate widget pathname strings coded manually in tcl/tk ( panel row cmdpython uses the addresses of widget class objects to fill in the path components and records pathnames in the widget tree label attached to containerfor instancemight have an assigned name such as inside tkinter you don' have to carethough simply make and link widget objects by passing parentsand let python manage pathname details based on the object tree see the end of this for more on tk/tkinter mappings graphical user interfaces