initial commit of project

This commit is contained in:
2021-04-11 19:51:12 +02:00
commit a21a8186d9
110 changed files with 16326178 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import os
import sys
import json
def get_input(file_path, print_config=False):
""" Retrieve user input in json format. """
# Check path exists
if not os.path.exists(file_path):
print('GetInput error: Input path does not exist:\n%s' %(file_path))
sys.exit(1)
else:
pass
# Retrieve user preferences from json file, return dict
with open(file_path, "r") as f:
config = json.load(f)
# Print nicely as json
if print_config:
print(json.dumps(config, indent=4, sort_keys=True))
return config