Learning tkinter

Jim Schwartz jschwar at sbcglobal.net
Thu May 18 10:50:38 EDT 2023


This works for me.  Hope it helps.

from tkinter import messagebox

messagebox.showerror("Hi", f"Hello World")

-----Original Message-----
From: Python-list <python-list-bounces+jschwar=sbcglobal.net at python.org> On Behalf Of Rob Cliffe via Python-list
Sent: Friday, May 12, 2023 3:55 AM
To: Python <python-list at python.org>
Subject: Learning tkinter

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?
TIA
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list