Re: String code required please
[EMAIL PROTECTED] wrote: > Does someone have the Python code to pull just the filename and > extension from the end of an absolute path please. > > Thanks in advance ... # Here you go... import os.path # Example path p1 = "C:\\WINDOWS\\system32\\DirectX\\Dinput\\mse.ini" # This will return: 'mse
Re: String code required please
import os fileName = os.path.basename(absolute) base, ext = os.path.splitext(fileName) Stani http://pythonide.stani.be -- http://mail.python.org/mailman/listinfo/python-list