使文件传输更容易的模块。
FileTransfer-LQR471814的Python项目详细描述
文件传输
一个python模块,使文件传输稍微容易一些
语法
FileTransfer.send(filepath="", socket=s)
FileTransfer.receive(destination_folder_path="", socket=s)
使用
正在发送
importsocketimportFileTransferasft# Setup socket for use in file transfers=socket.socket(socket.AF_INET,socket.SOCK_STREAM)s.connect("ip.address",port)ft.send(filepath,s)# Specify filepath as str and use client socket object
接收
^{pr2}$协议(TCP)
Filename Length | Filename | Payload Length (File Contents Length) | Payload (File Contents) |
---|---|---|---|
^{ | ^{ | ^{ | ^{ |
- 项目
标签: