|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import easygui
import sys
while 1:
easygui.msgbox("hello")
msg = "How are you?"
title = "a boring game"
choices = ["There's none of you busness","I'am fine thank you","......"]
choice = easygui.choicebox(msg,title,choices)
if choice == "......":
easygui.msgbox("you didn't say anything")
easygui.msgbox("say some thing please.")
else:
easygui.msgbox("you say:"+str(choice),"end")
easygui.msgbox("Well")
easygui.msgbox("Some body ask you for the time.Even know you didn't know the actually time.")
msg = "What time is it?"
title = "a boring game"
choices = ["I don't know","Don't ask me","......","It's 9p.m."]
choice = easygui.choicebox(msg,title,choices)
if choice == "......":
easygui.msgbox("you didn't say anything")
easygui.msgbox("say some thing please.")
else:
if choice == "It's 9p.m.":
easygui.msgbox("you say:"+str(choice),"end")
easygui.msgbox("Are you kidding me.It still in the morning")
else:
easygui.msgbox("you say:"+str(choice),"end")
easygui.msgbox("Man who can tell me the time?")
easygui.msgbox("you went away.")
msg = "play it again?"
title = "chose"
if easygui.ccbox(msg,title):
pass
else:
sys.exit(0)
这一段代码开始还没问题,为什么退出去重进就会提示
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\easygui.py", line 1, in <module>
import easygui
File "C:\Users\Administrator\Desktop\easygui.py", line 5, in <module>
easygui.msgbox("hello")
AttributeError: 'module' object has no attribute 'msgbox'
把你的程序文件名改成其他的,总之不要命名为 easygui.py
|
|