Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.
Discussion options

You must be logged in to vote

I found the answer to my own question.

import json
import os
import appdirs

DATA_DIR = appdirs.user_data_dir(appname="mu", appauthor="python")
try:
    with open(os.path.join(DATA_DIR, "session.json")) as fp:
        settings = json.load(fp)
except FileNotFoundError:
    settings = {}
    
if 'theme' in settings:
    print(settings['theme'])
if 'locale' in settings:
    print(settings['locale'])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aroberge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant