5

I'm trying to run this code which I got here:

from tkinter import *

import tkSimpleDialog

import tkMessageBox

 root = Tk()
 w = Label(root, text= "My Program")
 w.pack()

 tkMessageBox.showinfo("Welcome", "Add welcome message here")

but this error occured:

I already look here ModuleNotFoundError: No module named x, but I can't understand the answers. I'm still new about these stuff.

Pentium
  • 71
  • 2
  • 5

1 Answers1

6

If you are using python 3, you will need to import it as tkinter.simpledialog. Likewise, MessageBox has been changed to tkinter.messagebox.

Brian
  • 823
  • 6
  • 14