Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

getenv python

# SOMETIMES YOU NEED TO LOAD THE ENV FIRST
# pip install python-dotenv
from dotenv import load_dotenv
load_dotenv()

# METHOD 1
from os import getenv
env = getenv("NOME_DA_VARIÁVEL")

# METHOD 2
from os import environ
env2 = environ['NOME_DA_VARIÁVEL']
 
PREVIOUS NEXT
Tagged: #getenv #python
ADD COMMENT
Topic
Name
3+1 =