1.导入socket
from socket import *2.创建socket
client_socket = socket(AF_INET, SOCK_STREAM)3.链接服务器
client_socket.connect(("192.168.1.100", 8080))4.发送数据
client_socket.send(data)5.关闭socket
client_socket.close()
本文共 256 字,大约阅读时间需要 1 分钟。
1.导入socket
from socket import *2.创建socket
client_socket = socket(AF_INET, SOCK_STREAM)3.链接服务器
client_socket.connect(("192.168.1.100", 8080))4.发送数据
client_socket.send(data)5.关闭socket
client_socket.close()
转载于:https://my.oschina.net/forchina/blog/1556962