Add .env variable in Python

Add environment variable in Python


Interactive recipe

You can use below interactive recipe to generate code. This recipe is available in MLJAR Studio.

Python code

# Python code will be here

Code explanation

  1. Check if .env file exists.
  2. Open .env file, if file exists then open in append mode.
  3. Write new secret to the file.
  4. Please remember to remove this code cell after successful execution. Please save notebook.