I need just the file name from a string containing the path to a file. The name of the file starts with zeros. This is problematic because the lstrip function strips them leaving this as the result: 6128.jpg How do I strip the path without losing the leading zeros in the file name? ―--------------------------------------------- import sys, os, win32com.client, string
teststring = 'C:\shoreline\dvd\prep area\800x\\006128.jpg' print string.lstrip(teststring, 'C:\shoreline\dvd\prep area\800x\\')
-- http://mail.python.org/mailman/listinfo/python-list