Skip to content

Instantly share code, notes, and snippets.

@1c7
Created July 29, 2013 11:31
Show Gist options
  • Save 1c7/6103727 to your computer and use it in GitHub Desktop.
Save 1c7/6103727 to your computer and use it in GitHub Desktop.
(Python) 获得文件的后缀
file_path = r'D:\Everything\Everything.exe'
l = str(file_path).split('.')
extension = l[len(l)-1]
print (extension)
# exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment