Tkinter - cannot import tklib

MRAB python at mrabarnett.plus.com
Mon Jun 20 20:03:10 EDT 2022


On 2022-06-20 23:43, Wolfgang Grafen wrote:
> Hello all,
> 
> I am an experienced Python user and struggle with following statement:
> 
>>>> from tklib import *
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ModuleNotFoundError: No module named 'tklib'
> 
> I tried to import tklib as shown above on following of my Python installations: Anaconda Python 3.8.3, Portable Python 3.9, Python 3.10.1, Python 2.7.10 with the same negative result.
> 
> I also tried to find help by googling - without success. Also I did not find a python module called tklib to install. Tkinter, ttk is working fine.
> 
> 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?
> 
I'm thinking that maybe that tutorial is about writing a module (called 
"tklib") to make it easier to write tkinter applications.

The tkinter "Text" widget, for example, doesn't have its own scrollbars 
(you have to add them separately and link them to the widget), so 
writing a module that defines a text-with-scrollbars widget is a good idea.


More information about the Python-list mailing list