Here's my code:
import json    
with open("json.items") as json_file:
        json_data = json.load(json_file)
It works fine when I move the json file into the same directory. However, I'm trying to get the json file from a different directory. How would I do that? This is what I have tried and its not working:
with open("/lowerfolder/json.items") as json_file:
Any help? Thanks
Depending on your platform, starting a path with / means absolute path from the root
Meaning a relative path should be open("lowerfolder/json.items") without the /
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With