所以,我试图制作一个程序,它接受你输入的骰子数量(最多5个),然后生成随机的骰子数。但是,当我运行此代码时:
diceAmount = Entry(root)
diceAmount.grid(row=1)
diceAmountint = int(diceAmount)
我一直收到以下错误消息:
int() argument must be a string, a bytes-like object or a number, not 'Entry'
我在网上的任何地方都找不到使用tkinter条目显示该错误消息的其他人
Tags:
int()函数不知道如何将Entry对象转换为int值。您需要从Entry对象的某些属性或方法中提供字符串、字节或数值,并将其传递到int(…)调用中
相关问题 更多 >
编程相关推荐