| from flask import Flask, request | |
| app = Flask(__name__) | |
| command = "idle" # 初始指令 | |
| def set_command(): | |
| global command | |
| command = request.json["command"] | |
| return {"status": "success", "command": command} | |
| def get_command(): | |
| return {"command": command} | |
| if __name__ == "__main__": | |
| app.run(host="0.0.0.0", port=5000) | |