给出以下变量:
fsw="M543x620S30006482x483S14c10520x483S14c51498x537S14c39492x593S20500496x582S22a04494x564"
如果我这样做:
z=[sub.split('x') for sub in re.findall("\d{3}x\d{3}",fsw[8:])]
它返回:
[['482', '483'], ['520', '483'], ['498', '537'], ['492', '593'], ['496', '582'], ['494', '564']]
但是我想得到一对成对的[[integers ([[482,483],[520,483],...])
。是否有单线可以执行此操作?
z=[map(lambda x: int(x), sub.split('x')) for sub in re.findall("\d{3}x\d{3}",fsw[8:])]