×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: Python
Posted by: M. Chris
Added: Apr 24, 2019 9:04 AM
Views: 3862
Tags: no tags
  1. >>> import os
  2. >>> filename, file_extension = os.path.splitext('/path/to/somefile.ext')
  3. >>> filename
  4. '/path/to/somefile'
  5. >>> file_extension
  6. '.ext'