Python Forum

Full Version: Where is the error?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello, i just wanna complete my program. But i don't know where the problem is...
i am using python 3.4.4
can u help me, please...

below is the code :

#try entry
#maked by MRX

#making frame
from tkinter import *
import messagebox
#message in messagebox
def hi():
    messagebox.showinfo('login', 'you have succes to login!')
a = Tk()
a.title("Login")

#making the contents
b = Frame(a)
Label(b, text='LOGIN').pack()
Label(b, text='name').pack(side=LEFT)
Entry(b, width=50).pack(side=LEFT)
Label(b, text='password').pack(side=LEFT)
Entry(b, width=50).pack(side=LEFT)
Button(b, text='login', command=hi).pack(side=RIGHT)
b.pack(fill=BOTH, expand=YES)

mainloop()
and when i run the code, it will display this:

Error:
Traceback (most recent call last): File "C:\Users\User\Desktop\tester\gamelogin+messagebox.py", line 6, in <module> import messagebox ImportError: No module named 'messagebox'
but, i have module named messagebox in my computer
thank you
(Jun-12-2018, 04:33 AM)MRX Wrote: [ -> ]i have module named messagebox in my computer

but is it in such location (path) so that it can be discovered during the import? :-)