qy.py: query identification, configuration and status of an U1401B

Keysight U1401B and Escort 2030 are process calibrators and multimeters in one device. Using the infrared serial-USB connection and SCPI commands *IDN?, CONF? and STAT? we can get some informations about them. There is also a loop for reading current and voltage. The rotary switch is set to current output, voltage input.
Here the Python2 program:

# qy.py
# query identification, configuration and status
import serial
import time
dmm=serial.Serial(port='/dev/ttyUSB0', baudrate=9600, bytesize=8,
stopbits=serial.STOPBITS_ONE)
try:
  dmm.open()
except Exception as e:
    print ('problem opening port: ' + str(e))
    exit()
slist = ['avg function','null function','unused','unused',
  'peak-hold function','unused','trigger mode I-IMM,B-BUS,R-REF',
  'slide position 0=M/S, 1=M','ambient temperature compensation',
  'beep 0=OFF, 1,2,4=kHz, F=600Hz','auto power OFF',
  'back lit','meter mode Local,Setup,Calibration',
  'input warning','output warning',
  'rotary pos(IO) 0=VP,1=VI,2=VV,3=mVV,4=RV,5=DV,6=IV,7=II,8=IP',
  'output status 0=standby','rate 4:50000 counts','battery 1=low',
  'power jack 1=plug in','auto 1=on']
print ("-----------------------------------------------")
print ('qy: query status')
# !!! dmm.write("*RST\r\n")
# !!! time.sleep(4)
dmm.write('*IDN?;:CONF?\r')
dmm.flushInput()
an1 = dmm.readline()[:-2]
an2 = dmm.readline()[:-2]
print 'Identification: ' + an1
print 'Configuration: ' + an2[1:-1]
print ("-----------------------------------------------")
dmm.write('STAT?\r\n')
sta = dmm.readline()[1:-3]
#print 'status:' + sta
for i in range(len(sta)):
  print slist[i] + ": " + sta[i]
print ("-----------------------------------------------")
while True:
  time.sleep(2)
  dmm.write('CURR?;:READ?\r\n')
  dmm.flushInput()
  dat1, dat2 = dmm.readline(), dmm.readline()
  data = dat1[:-2] + '  ' + dat2[:-2]
  print (' -> ' + data)
  time.sleep(30)