Is there a function to extract the extension from a filename?
You can use a split on a filename:
split
filename
f_extns = filename.split(".") print ("The extension of the file is : " + repr(f_extns[-1]))
This does not require additional library