服务端
import socket
s = socket.socket()
s.bind(('0.0.0.0',1234)) #主机ip,端口号
s.listen() #等待连接
c,addr = s.accept() #等待连接
print(c)
print(addr)
客户端
import socket标签:socket,0.0,通信,print,接字,连接,端口号 From: https://www.cnblogs.com/lld76/p/15959222.html
s = socket.socket()
s.connect(('127.0.0.1',1234))#连接服务器的ip地址,端口号
print('连接成功')