I have selected several files with the open multiple files dialog:

[[u'C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\chord.jpg'], [u'C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\toad1.jpeg', u'C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\21369.jpg', u'C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\g2.jpg']]

I want to display the selected files in a nice user-friendly way. Just the filenames, each on a separate line. No paths, commas or brackets.

Can someone nudge me in the right direction please? Thanks.

Recommended Answers

Use os.path.basename(path) to get the filename from the path.

Jump to Post

All 2 Replies

Use os.path.basename(path) to get the filename from the path.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.