It works:
>>> 'ab c'.split(None, 1) ['a', 'b c']
Document:
S.split (sep = None, maxsplit = -1) -> list of strings
Returns a list of words in S, using sep as a separator string. If maxsplit is specified, maximum maxsplit is broken. If sep is not specified or None, the whitespace line is a separator, and empty lines are removed from the result.
In interactive mode, you should learn:
>>> help('a'.split)
In IPython, just use the question mark:
In [1]: s = 'a' In [2]: s.split?
I would suggest using IPython and especially Notebook. This makes such a study much more convenient.
source share