TkMessageBox - No Module

Tom Lowbridge picture Tom Lowbridge · Jul 4, 2016 · Viewed 59.3k times · Source
import TkMessageBox

When I import TkMessageBox it displays the messsge 'ImportError: No module named 'TkMessageBox'.

As far as I know im using python 3.3.2 and Tk 8.5.

Am I using the wrong version of python or importing it wrong ?

Any answers would be extremely useful. Alternatively is there something similar in the version i am using?

Answer

Billal Begueradj picture Billal Begueradj · Jul 4, 2016

In Python3.x things have changed a little bit:

   >>> import tkinter
   >>> import tkinter.messagebox
   >>>

I mean what we call tkMessageBox in Python2.x becomes tkinter.messagebox in Python3.x