# http://myinventions.pl import serial port = serial.Serial('COM4', 9600) for i in range(0, 1000): dane=open('dane.txt', 'r+b') #read/write binary x = port.read(size=1) dane.write(x) print ord(x) dane.close() port.close()