35课后作业,easygui使用不了了
import randomimport easygui
easygui.msgbox('欢迎来到tan的游戏界面')
secret = random.randint(1, 10)
msg = '猜猜我想的几?'
title = '数字小游戏'
guess = easygui.integerbox(msg, title, lowerbound=1, upperbound=10)
while True:
if guess == secret:
geasygui.msgbox('nice')
break
else:
if guess > secret:
easygui.msgbox('big')
else:
easygui.msgbox('small')
guess = easygui.integerbox(msg, title, lowerbound=1, upperbound=10)
easygui.msgbox('game over')
Traceback (most recent call last):
File "d:/learn/新版教学视频小甲鱼/35/daima.py", line 1, in <module>
import easygui as g
File "d:\learn\新版教学视频小甲鱼\35\easygui.py", line 4, in <module>
easygui.msgbox('欢迎来到tan的游戏界面')
AttributeError: partially initialized module 'easygui' has no attribute 'msgbox' (most likely due to
说是循环导入了,怎么办 文件名不要叫 easygui.py,因为会跟 EasyGUI 模块(也叫 easygui.py)冲突。 小甲鱼 发表于 2021-2-28 17:01
文件名不要叫 easygui.py,因为会跟 EasyGUI 模块(也叫 easygui.py)冲突。
好的,小甲鱼{:5_109:}
页:
[1]