Calmcode Summary

ArjanCodes Summary

Move down in the directory tree and load json-file

cwd = Path.cwd() # get current working directory
print(cwd)
os.chdir('..')   # move down in the directory tree
cwd = Path.cwd() # get current working directory
print(cwd)

C:\\Analysen\\parent\\child

C:\\Analysen\\parent

Load json-file

# Create a Path object for the JSON file
json_file = cwd.joinpath(cwd, "credentials.json")
print("JSON file:", json_file)

# Open the JSON file
with open(json_file) as f:
    data = json.load(f)