You can use re module: import re txt = 'foo,bar,hello, you' print( re.split(r',(?=[^\s]+)', txt) ). Prints: ['foo', 'bar', 'hello, you'].
確定! 回上一頁