To get the file extension in python you can use the following snippet.
Sample Python
import os.path filePath = "C:\Users\Codesnippets\Desktop\testfolder\test.bat" print os.path.splitext(filePath)[1]
All the Code Snippets and Samples you need
To get the file extension in python you can use the following snippet.
import os.path filePath = "C:\Users\Codesnippets\Desktop\testfolder\test.bat" print os.path.splitext(filePath)[1]
You must be logged in to post a comment.
RT @CodeSnippetsNET: How to get the file extension in #Python http://t.co/dxqC2HX5MO #programming #code #coding #dev
RT @CodeSnippetsNET: How to get the file extension in #Python http://t.co/dxqC2HX5MO #programming #code #coding #dev