import os.path def file_extension(path): return os.path.splitext(path)[1]