Tkinter - cannot import tklib

Dennis Lee Bieber wlfraed at ix.netcom.com
Mon Jun 20 20:43:18 EDT 2022


On Mon, 20 Jun 2022 15:43:26 -0700 (PDT), Wolfgang Grafen
<wolfgang.grafen at gmail.com> declaimed the following:

>
>There are numerous examples using "from tklib import *" so I assume it works for most. In the tk-tutorial below tklib is used without special explanation, so I assume it should be installed by default with every python installation which has Tkinter integrated. 
>
>https://tk-tutorial.readthedocs.io/en/latest/intro/intro.html?highlight=app#
>
>First time that I cannot help myself. Please help, what do I do wrong?
>

	From what I can see, you haven't /written/ a tklib module.

	That tutorial assumes you will create a module containing a number of
simplified interfaces to tk widgets. cf:
https://tk-tutorial.readthedocs.io/en/latest/radio/radio.html#a-better-radiobutton-class
tklib.py will contain the definition of the Radiobutton class. The same
probably applies everywhere that you see tklib imported -- whatever classes
are used to create widgets need to be defined in that file.

https://tk-tutorial.readthedocs.io/en/latest/intro/intro.html?highlight=app#
"""
In the following section we are going to redefine the tk and ttk objects.
To make it easier to use them, we follow these design principles:

    we keep the excact same class names
    the parent object is chosen automatically
    all keyword arguments are forwarded

The first widget to consider is the Label which just places static text.
Where it makes sense, a label will be combined with a button or entry
widget.
"""

https://tk-tutorial.readthedocs.io/en/latest/check/check.html#a-better-checkbutton-class
etc.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/


More information about the Python-list mailing list