How to remove the path and keep only the filename in python code example Example: python get filename from path import os print(os.path.basename(your_path))