I'm new to python and I've not used os.path that often, but as my projects grew and I started trying to integrate multiple folders together, I realized that it is probably best that I start using the os.path method.
I'm currently trying to get to a json file data.json
in a folder (that is within several other folders). I looked at the way it is done online but I think I confused myself.
import os
import json
x = os.path.join('c:', 'data.json')
data = json.loads(open(x).read())
print(data)
Error message:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Obada\\OneDrive\\Documents\\VS Code Projects\\Basic Chatbot\\data'