Untitled
unknown
plain_text
2 years ago
507 B
9
Indexable
with open(dotenv_path) as f:
for line in f:
# Strip whitespace and ignore comments
line = line.strip()
if not line or line.startswith('#'):
continue
# Split the key and value
key, value = line.split('=', 1)
key = key.strip()
value = value.strip().strip('"').strip("'") # Remove extra spaces and quotes
# Set the environment variable
os.environ[key] = valueEditor is loading...
Leave a Comment