比如我有个按钮 点一下就打印一行字符串
import tkinter as tk
root = tk.Tk()
def say():
print("点击成功!")
frame = tk.Frame(root)
frame.pack()
hi_there = tk.Button(frame, text="打招呼", fg="blue", command=say)
hi_there.pack(side=tk.LEFT)
root.mainloop()
问题相关代码
我通过flask可以搭建一个本地防web服务器,我想在这个web服务器上建立index.html,里面有个按钮,点击后就可以发送 POST (JSON格式) 的数据
如何让python接收到这个数据,然后触发say()
#其实我就是想通过局域网来进行操控