import configparser
import sys

import accounts

cp = configparser.ConfigParser()
cp.read(accounts.getFile('inf.cfg'))

def get(param, typename='s'):
    param = param.split('.')
    try:
        if typename == 's':
            return cp[param[0]].get(param[1])
        elif typename == 'i':
            return cp[param[0]].getint(param[1])
        elif typename == 'f':
            return cp[param[0]].getfloat(param[1])
        elif typename == 'b':
            return cp[param[0]].getboolean(param[1])
    except KeyError:
        print('Parameter {}.{} does not exist'.format(*param))
        sys.exit()

@@ -42,16 +42,94 @@
 counts%0A%0A
+cp = None%0A%0Adef get(param, typename='s'):%0A    global cp%0A    if not cp:%0A        
 cp = con
@@ -153,16 +153,24 @@
 arser()%0A
+        
 cp.read(
@@ -201,39 +201,8 @@
 g'))
-%0A%0Adef get(param, typename='s'):
 %0A   

Load config on demand