use os.path.splitext()