Anshuman
Anshuman

Reputation: 67

How do I get a message box in Python 2.7.5

>>> from Tkinter import tkMessageBox

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    from Tkinter import tkMessageBox
ImportError: cannot import name tkMessageBox

I am getting this error, even though from Tkinter import * is working fine. I am using Python 2.7.5.

Upvotes: 5

Views: 15150

Answers (1)

Andrei
Andrei

Reputation: 56688

tkMessageBox is a module on its own, so you should import it separately:

import Tkinter 
import tkMessageBox

Upvotes: 13

Related Questions