how to take only the filename alone from a directory using python code example Example: python get filename from path import os print(os.path.basename(your_path))