Re: Retrieving Filename from Path

2005-08-31 Thread Rob Cowie
Thanks, os.path.basename(filePath) it is then. BTW, the help(module) function is new to me! Must have missed it when reading the tutorial. Cheers! -- http://mail.python.org/mailman/listinfo/python-list

Re: Retrieving Filename from Path

2005-08-31 Thread robert . dowell
>>> import os.path >>> help(os.path) Help on module ntpath: NAME ntpath - Common pathname manipulations, WindowsNT/95 version. FILE c:\data\utils\python24\lib\ntpath.py DESCRIPTION Instead of importing this module directly, import os and refer to this module as os.path. FUNCTION

Retrieving Filename from Path

2005-08-31 Thread Rob Cowie
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string using '/' as delimiters and get the last 'word'. The reason I'm not entirely happy with that method is t