python instead of absolute path only print fine name code example Example: python get filename from path import os print(os.path.basename(your_path))