Wednesday, January 22, 2014

Get the final component of a path

Example:

source_path = r'D:\test\S3-pdf-save\test.pdf'
os.path.basename(source_path)

output:
test.pdf

No comments:

Post a Comment