1.先导入socket这个必要的库`
import scoket
2.创建套接字服务器连接客户端
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.9.212', 6666))
3.读取图片地址
filepath = input('input the file:')
fhead = struct.pack(b'128sq', bytes(os.path.basename(filepath), encoding='utf-8'),
os.stat(filepath).st_size)
s.send(fhead)
4.结束
s.send(data)
s.close()