1、#传输文件的例子
import socket
from socket import *
import os
import requests
import time,socketserver,struct,os,_thread
def conn_thread(conn,addr): while 1: try: conn.settimeout(600) fileinfo_size=struct.calcsize('30sl') buf=conn.recv(fileinfo_size) if buf: filename,filesize=struct.unpack('30sl',buf) filename_f=filename.decode().strip('