str.split
区切り文字も返すPythonに相当するものはありますか?
いくつかのトークンを処理した後、出力用に空白のレイアウトを保持する必要があります。
例:
>>> s="\tthis is an example"
>>> print s.split()
['this', 'is', 'an', 'example']
>>> print what_I_want(s)
['\t', 'this', ' ', 'is', ' ', 'an', ' ', 'example']
ありがとう!