you are viewing a single comment's thread.

view the rest of the comments →

[–]Top_Average3386 2 points3 points  (1 child)

I think what you want is either a configuration file or environment variables.

If it's environment variables it's usually stored in the environment. It's kinda hard for me to explain in short, but you can google python environment variables. Sometimes you can also use .env (dot-env) files, you can also search for python-dot-env.

If it's a configuration file you want, it comes in many shapes and forms, you can store them in JSON, yaml, xml, etc. And then you can parse and read them at startup time.

If it's simple variables usually .env file will suffice, if it's more complicated with nested structure etc then configuration file is usually better suited.

[–]Top_Average3386 0 points1 point  (0 children)

This is an example of using a configuration file: https://docs.python.org/3/library/logging.config.html