devttys0 / serio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Limit to 81 characters

popado opened this issue · comments

Wonderful idea ! I try transfer from PC to Raspberry Pi, but rezult was:

C:\Python27>python serio.py -s paramiko-master.zip -p COM7 -b 115200 -d /home/pi
/alfa.zip
20 / 81
40 / 81
60 / 81
80 / 81
81 / 81
Uploaded 81 bytes from paramiko-master.zip to /home/pi/alfa.zip

C:\Python27>

alfa.zip have only 81 bytes, bat source have 348304 bytes. What I do wrong ? Thank you.

I modify in this way:

def put(self, source, destination):
data = open(source, 'rb').read() ## to read binary file
data_size = len(data)

and now work fine. Thank you. Useful program !

Updated code to open binary file in binary mode explicitly. Thanks!