Python~Python发送TCP数据

from socket import *

# TCP
client=socket(AF_INET, SOCK_STREAM)
client.connect(('192.168.10.101', 8001))
msg = input("=>")
client.send(msg.encode('utf-8'))
client.close()

你可能感兴趣的:(Water,tcp/ip,网络,服务器,python)