trouble using "\" as a string

Justin Azoff justin.azoff at gmail.com
Mon Aug 21 01:25:40 EDT 2006


OriginalBrownster wrote:
> i want this because using python I am pulling in filenames from a
> mac..thus they are "/" in the pathways..and i want to .split it at the
> "/" to obtain the filename at the end...but its proving diffucult with
> this obstacle in the way.

sounds like you want
import posixpath
posixpath.basename(path)

assuming you are on a windows box,otherwise the normal os.path.basename
will do it.

-- 
- Justin




More information about the Python-list mailing list