Search code examples
pythonpython-3.xtkintertk-toolkit

TkMessageBox - No Module


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?


Solution

  • 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