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