Is there a function to extract the extension from a filename?
name_only=file_name[:filename.index(".")
That will give you the file name up to the first ".", which would be the most common.