马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
报错:Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Mike\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "g:/Programming/Python/pa_chong/requests基本使用/2.请求头.py", line 7, in b
print(ord(aa))
TypeError: ord() expected a character, but string of length 0 found
代码from tkinter import *
root = Tk()
def b():
aa = a.get()
print(ord(aa))
a = Entry(root)
a.pack()
Button(root, command=b).pack()
root.mainloop()
求解
本帖最后由 Twilight6 于 2020-5-31 09:21 编辑
def b():
aa = a.get()
for i in aa:
print(ord(i),end='')
|