python script get file extension code example
Example 1: python get file extension from path
import os.path
extension = os.path.splitext(filename)[1]
Example 2: Python file extension
filename = input("Input the Filename: ")
f_extns = filename.split(".")
print ("The extension of the file is : " + repr(f_extns[-1]))