Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where is the error?
#1
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
Reply
#2
(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? :-)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020