how to find extension of a file in python from url code example Example: python get file extension from path import os.path extension = os.path.splitext(filename)[1]