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