friendly-traceback / friendly

Friendly-traceback's version used in most situations
https://friendly-traceback.github.io/docs/index.html
MIT License
40 stars 5 forks source link

Save configuration file #13

Closed aroberge closed 2 years ago

aroberge commented 2 years ago

friendly should record information used (e.g. last language, color/theme, etc.) for the various environments (Mu, Jupyter, etc.) so that they can be used as default for subsequent runs.

aroberge commented 2 years ago

I should use something like https://github.com/ActiveState/appdirs to follow best practices as to where to save the configuration file.

aroberge commented 2 years ago

Use psutil (additional dependency) to determine the type of terminal run:

parent_pid = os.getppid()
print(psutil.Process(parent_pid).parent().name())

Detect if running from VS Code by detecting "TERM_PROGRAM in os.environ and os.environ["TERM_PROGRAM"] = "vscode"

aroberge commented 2 years ago

In os.environ FOR Pycharm:

TERMINAL_EMULATOR JetBrains-JediTerm
aroberge commented 2 years ago

psutil is not a simple python package: it failed to install on my system.

aroberge commented 2 years ago

This has been implemented for quite a while now.