Skip to content

Instantly share code, notes, and snippets.

@romach
Last active April 2, 2017 19:55
Show Gist options
  • Save romach/7e9bd6d46c8de03d41c46ccae86956e3 to your computer and use it in GitHub Desktop.
Save romach/7e9bd6d46c8de03d41c46ccae86956e3 to your computer and use it in GitHub Desktop.
Extract extension from filename
import os
filename = os.path.splitext('/path/to/somefile.ext')[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment