使用python3代码写一段能从一个服务器读取指令然后再把结果回传给另外一个服务器
时间: 2023-03-03 13:18:07 浏览: 85
import requests
url1 = "http://server1.example.com/get_command"
url2 = "http://server2.example.com/post_result"
while True:
response1 = requests.get(url1)
command = response1.text
# Execute the command
result = execute_command(command)
# Post the result back to server2
response2 = requests.post(url2, data=result)
阅读全文