get a field

Jean-Michel Pichavant jeanmichel at sequans.com
Mon Feb 15 11:50:41 EST 2010


mierdatutis mi wrote:
> Hi,
>
> I have this:
>
> pe="http://www.rtve.es/mediateca/videos/20100211/saber-comer---patatas-castellanas-costillas-11-02-10/691046.shtml"
>
>
> I would like to extract this: 691046.shtml
>
> But is dynamically. Not always have the same lenght the string.
>
> Could you help me how could I do extract this in python?
>
> Many thanks and sorry for my English!
>
In [2]: import os

In [3]: os.path.basename(pe)
Out[3]: '691046.shtml'

JM



More information about the Python-list mailing list