nos0s/groundwork/config_loader.py
2023-03-21 17:52:27 -04:00

27 lines
449 B
Python

import yaml
config = None
def read_config():
global config
with open ("config.yaml", "r") as conf_file:
try:
config = yaml.safe_load(conf_file)
except:
print("Error reading config")
config = None
def get_config():
global config
if config == None:
read_config()
return config
def main():
print(get_config())
read_config()
if __name__ == "__main__":
main()