how to take from the path the last file name code example Example: python get filename from path import os print(os.path.basename(your_path))