splitting string

Laura McCord Laura.McCord at doucet-austin.com
Wed Jul 7 11:33:21 EDT 2004


I want to split a filename string such as Y:\folder\directory\file 

it is stored like this in my python code:
 fname = self.filename

How can I get rid of everything before the word 'file'?

I had tried something like this:
 fname = self.filename
 s = fname.split("\")
 fname = s[-1]

Any suggestions?

Thanks

 



More information about the Python-list mailing list