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
/means absolute path from the rootopen("lowerfolder/json.items")without the/open('./lowerfolder/json.items'), or use a full absolute path (e.g.open('/home/strikepricer/files/lowerfolder/json.items')).