hi,

what about this


>>> 'exe.torrent'.split('.')[0]
'exe'
>>> 'exe.torrent'.rstrip('toren').rstrip('.')
'exe'
>>>

that's what you need, isn't it?

On Friday 23 November 2007 05:09:50 am kyo guan wrote:
> Hi :
>
>       Please look at this code:
> >>> 'exe.torrent'.rstrip('.torrent')
>
> 'ex'                  <-----  it should be 'exe', why?
>
> but this is a right answer:
> >>> '120.exe'.rstrip('.exe')
>
> '120'                 <------ this is a right value.
>
>       there is a bug in the rstrip, lstrip there isn't this problem.
>
>
>
> Kyo.


michael
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to