Maintaining leading zeros with the lstrip string function?

Randy Kreuziger KREUZRSK at DFW.WA.GOV
Tue Jul 24 01:55:39 CEST 2007


Thanks for the basename suggestion.  That almost works.  I'm running into a problem with some of the directory names when they include \800x\   see below.
―-----------------------------------------------------------------------------
import sys, os, string

teststring = 'C:\shoreline\dvd\prep area\800x\060623_00001.jpg'
print  os.path.basename(teststring)
―-----------------------------------------------------------------------------
Results in 
800x0623_00001.jpg
 
But it needs to be
060623_00001.jpg

 
 
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070723/020b1da7/attachment.html>


More information about the Python-list mailing list