You can use regex
here:
>>> import re
>>> strs = "foobarspam"
>>> re.split(r'+', strs)
['foo', 'bar', 'spam']
update:
You can use str.rstrip
to get rid of trailing ''
and then apply regex.
>>> yas = "yasbscda"
>>> re.split(r'+', yas.rstrip(''))
['yas', 'bs', 'cda']
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…