# Pastebin ptwMO3au # Pastebin tl1cxtVs import serial port = serial.Serial( port="COM1", baudrate=9600, bytesize=serial.SEVENBITS, parity=serial.PARITY_EVEN, stopbits=serial.STOPBITS_ONE, timeout=1, ) measure = b'MEAS?\r' identify = b'*IDN?\r\n' port.flushInput() port.write(identify) port.flushOutput() read_tp4 = port.readall() decode_tp4 = read_tp4.decode('utf-8') print(decode_tp4)