"kj" 写入消息 news:h0e3p9$85...@reader1.panix.com...
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
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
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"
дÈëÏûÏ¢ÐÂÎÅ:nfi3m.2341$ze1.1...@news-server.bigpond.net.au...
> Brad wrote:
>> On Jul 2, 9:40 pm, "Pablo Torres N." wrote:
>>>