字符串按空格拆分

In [97]: lines
Out[97]: 'W1-XXX-X6000 Xi0/1/2/9 XtoX XX 26 L2 UXXble'

In [100]: list_sk = re.split('\s+',lines)

In [101]: list_sk
Out[101]: ['W1-XXX-X6000', 'Xi0/1/2/9', 'XtoX', 'XX', '26', 'L2', 'UXXble']

你可能感兴趣的:(字符串按空格拆分)