code: import serial,time,itertools try: ser=serial.Serial(2,115200,timeout=0) except: print 'Open COM2 Failed!!' #transno=(1,100,500,1380,1381) #transno=(1,20) indexsets=[[0],[1],[2],[3],[0,1],[0,2],[0,3],[1,2],[1,3],[2,3],[0,1,2],[0,1,3],[0,2,3],[1,…