程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

I want to send a post request through a web page, and then Python receives it. How to operate

編輯:Python

For example, I have a button Click to print a line of string

import tkinter as tkroot = tk.Tk()def say(): print(" Click success !")frame = tk.Frame(root)frame.pack()hi_there = tk.Button(frame, text=" Say hello ", fg="blue", command=say)hi_there.pack(side=tk.LEFT)root.mainloop()

I passed flask You can set up a local anti - web The server , I think in this web Set up on the server index.html, There's a button inside , Click to send POST (JSON Format ) The data of
How to make python Received this data , Then the trigger say()

# In fact, I just want to control through the LAN




Take the answer :

flask Interface with post receive data content = request.form.get("content") Then call say That's all right.



  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved