so i want to read things from a file without having the full path, how can i do it? My current code
import json
file1= 'C:\\Users\\klaus\\OneDrive\\Desktop\\Script\\Mediamarktp.json'
with open(file1, 'r') as handle:
json_out = json.load(handle)
profile_name = ['Profile1']
data = [x for x in json_out if x['profilename'] in profile_name]
email = (data[0]['email'])
password = (data[0]['password'])
website = (data[0]['website'])
precart = (data[0]['precart']=='True')
profilename1 = (data[0]['profilename1'])
proxy = (data[0]['proxy']=='True')
print(email)
print(password)
print(precart)
file1 is at the moment = 'C:\Users\klaus\OneDrive\Desktop\Script\Mediamarktp.json' but i want my script to open it with just looking for = '\Script\Mediamarktp.json' like
file1 = 'C:\\*\\Script\\Mediamarktp.json'
How can i do it?