def read_conf(filename, optnames):
    '''Read configuration file return elements hash'''
    # Load file & eval
    h = {}
    execfile(filename, globals(), h)
    # Get only what we want 
    options = {}
    for item in h:
        if isinstance(h[item], employee) or (item in optnames):
            options[item] = h[item]

    return options
Read configuration file return elements hash
recipes/Python/231516_Using/recipe-231516.py