jack morris
jack morris

Reputation: 1

Storing data locally (tkinter)

I am making a program with various features. The program stores all the user's preferences (customtkinter string variables) in a .json file located in the same directory. However, when running it on certain devices, it gives me an errno 13 and denies permission to read/edit the file.

I have tried reasarching other data storing modules (such as sqlite3, configparser, python-dotenv), but these also give an errno 13. Is there a method of storing the prefrences some other way?

Upvotes: 0

Views: 44

Answers (1)

AKX
AKX

Reputation: 169338

You can use e.g. platformdirs to find a suitable "user data" directory for your app, instead of "same directory".

import platformdirs

jacks_app_data_dir = platformdirs.user_data_dir("appwithvariousfeatures", "jackmorris")

Upvotes: 0

Related Questions