You could use the serial module, which can be found at http://pyserial.sourceforge.net/ import serial ser = serial.Serial(0, timeout=1) ser.write("Something") input = ser.read() #reads one byte input = ser.readline() #reads a line input = ser.read(7) # reads 7 bytes ser.close()