Lets say I want to save some content in a JSON file, like this:
with open('C:\\Users\\my_user\\Downloads\\test.json','w') as new_f:
json.dump(found_database, new_f, indent=4, sort_keys=True)
And I want to save it into the Downloads folder of the users' machine.
How can I set the path to the Downloads folder not knowing the user/computer name? Something like this:
with open('C:\\Users\\%user name%\\Downloads\\test.json','w') as new_f:
If the user is from a different country, like an Asian one, does the structure of the path changes? I mean, do they use the same backslash as we use to do it? If not, is there a way to make the path work in any machine, no matter the country?
Also, for instance, in Brazil they use C:\Usuários instead of C:\Users. Is this a problem when trying to do it?
Thank you!