16
如果我想要拆分一個分隔符分開的單詞列表,我可以用如何快速解析字符串列表
>>> 'abc,foo,bar'.split(',')
['abc', 'foo', 'bar']
但是,如何方便快捷地做同樣的事情,如果我也想處理可以包含分隔符的引用字符串?
In: 'abc,"a string, with a comma","another, one"'
Out: ['abc', 'a string, with a comma', 'another, one']
相關問題:How can i parse a comma delimited string into a list (caveat)?
尼斯之一。智能使用模塊:-) – 2008-12-01 14:33:42