标签:
with open(file, ‘wb‘) as f1:recv_size = 0while recv_size < file_size:data = self.sk.recv(1024)recv_size += len(data)f1.write(data)
print(self.sk.recv(1024).decode()) # 打印友好信息print(‘send_file:{} md5_sum:{}‘.format(file_size, file_sum), ‘recv_file:{} md5_sum:{}‘.format(recv_size, md5_sum), sep=‘\n‘) # 打印文件md5值
标签:
原文地址:http://www.cnblogs.com/qiaogy/p/5845409.html