# # parse Msp Schwellen Output 1 # In [24]: a = '1.0e-10,4' In [25]: patt=re.compile( "(.+),(\d+)") In [26]: res = patt.match( a) In [27]: res.group(1) Out[27]: '1.0e-10' In [28]: res.group(2) Out[28]: '4' # # parse Msp Schwellen Output 2 # In [42]: a = "[5.00e-01,2],28,32" In [43]: patt=re.compile( "\[(.+)\],(.+)") In [44]: res = patt.match( a) In [45]: res.groups() Out[45]: ('5.00e-01,2', '28,32')