Just a shorter implementation:
from itertools import groupby
def split(lst, func):
gs = groupby(lst, func)
return list(gs[True]), list(gs[False])
"Lie Ryan"
дÈëÏûÏ¢ÐÂÎÅ:[email protected]...
> Brad wrote:
>> On Jul 2, 9:40 pm, "Pablo Torres N." wrote:
>>>
I want to ensure that the url ends with a '/', now I have to do thisa like
below.
url = url + '' if url[-1] == '/' else '/'
Is there a better way?
--
http://mail.python.org/mailman/listinfo/python-list
"kj" 写入消息 news:[email protected]...
In "tsangpo"
writes:
I want to ensure that the url ends with a '/', now I have to do thisa like
below.
url = url + '' if url[-1] == '/' else '/'
Is there a better way?
I