import os
#just write the whole file path in the change directory function
os.chdir('C:User/.../the_name_of_the_directory')
#Just fo check
os.getcwd()
print(os. getcwd())
path_parent = os. path. dirname(os. getcwd())
os. chdir(path_parent)
print(os. getcwd())