DIRECTORY and FILENAME python code example Example: python file directory from os import path dir_path = path.dirname(__file__)