Learning tkinter

MRAB python at mrabarnett.plus.com
Thu May 18 13:31:15 EDT 2023


On 2023-05-12 09:55, Rob Cliffe via Python-list wrote:
> I am trying to learn tkinter.
> Several examples on the internet refer to a messagebox class
> (tkinter.messagebox).
> But:
> 
> Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32
> bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>   >>> import tkinter
>   >>> tkinter.messagebox
> Traceback (most recent call last):
>     File "<stdin>", line 1, in <module>
> AttributeError: module 'tkinter' has no attribute 'messagebox'
>   >>>
> 
> Why is this?

It's a submodule of tkinter:

 >>> import tkinter.messagebox as mb
 >>> mb.showinfo
<function showinfo at 0x000001994C7F2020>



More information about the Python-list mailing list