config.py 239 B

123456789101112
  1. from os import getenv
  2. from dotenv import dotenv_values
  3. if env_var := dotenv_values('token'):
  4. API_TOKEN = env_var["API_TOKEN"]
  5. else:
  6. API_TOKEN = getenv("API_TOKEN")
  7. print(API_TOKEN)
  8. if __name__ == "__main__":
  9. print(API_TOKEN)