Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 882
Tom Lowbridge Avatar asked Jul 04 '16 09:07

Tom Lowbridge


People also ask

What is tkMessageBox in python?

The tkMessageBox module is used to display message boxes in your applications. This module provides a number of functions that you can use to display an appropriate message. Some of these functions are showinfo, showwarning, showerror, askquestion, askokcancel, askyesno, and askretryignore.


1 Answers

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

like image 129
Billal Begueradj Avatar answered Sep 24 '22 13:09

Billal Begueradj