File size: 463 Bytes
5775680
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import json



def write_config(configs,file_name='server_config.json'):
    print(json.dumps(configs))
    with open(file_name, 'w') as outfile:
            json.dump(configs, outfile)


def read_config(file_name='server_config.json'):
    try:
        with open(file_name) as json_file:
            data = json.load(json_file)
            #print(data)
            return data
    except:
        print("Unable to open config file:",file_name)
        return {}