from serial import Serial ser = Serial('COM4', 9600) s = ser.read(100) # read up to one hundred bytes