我正在尝试创建一个 python 文件,该文件将向包含 .txt 文件的目录发送垃圾邮件。
我决定开始使用 Tkinter,但是每当我尝试输入数字时,我都会收到此错误消息"TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'"
我正在使用的代码是:
from tkinter import *
top = Tk()
top.geometry("400x250")
Amount = Label(top, text = "Amount").place(x = 30,y = 50)
def spam():
for i in range(int(e1)):
print(i)
sbmitbtn = Button(top, text = "Submit",activebackground = "pink", activeforeground = "blue",command=spam).place(x = 30, y = 170)
e1 = Entry(top).place(x = 80, y = 50)
top.mainloop()
我已经厌倦了切换到 for i in range(int(e1)):, for i in range(str(e1)): 但随后我收到错误消息:
"TypeError: 'str' object cannot be interpreted as an integer"
任何帮助都是好帮助
慕虎7371278
慕哥9229398
相关分类