For my Python applications I want to use variables from an .env file, so I can store this in a local file for configuration flexibility.
Example:
OPENAI_API_KEY=mySecretKey
import os from dotenv import load_dotenv # .env-Datei laden load_dotenv() print("OPENAI_API_KEY: " + os.getenv("OPENAI_API_KEY"))
python envexample.py OPENAI_API_KEY: mySecretKey