vAnalytics/src/globals.py

15 lines
460 B
Python

import os
# Load environment variables from .env file
def load_env():
try:
with open(".env") as f:
for line in f:
line = line.strip()
if line and not line.startswith("#"):
key, value = line.split("=", 1)
os.environ[key.strip()] = value.strip()
except FileNotFoundError:
print("No .env file found. Using default environment variables.")