changing filepath and creating directory in python
Python has useful functions built-in to handle common pathname manipulations.

import os
desired_path = os.path.join(some_existing_path, "some_folder", "some_file_name.ext")


See os.path, and see shutils for high-level file operations.

to test if a directory exists, and make it when not found):

if not os.path.exists(directory_to_test):
    os.makedirs(directory_to_test)