def readfileintodict(filename, d):
    ''' Read key=value pairs from a file, into a dict.
        Skip comments; strip newline characters and spacing.
    '''
    with open(filename, 'r') as f:
        lines = f.readlines()
    for l in lines:
        if l[:1] == '#':
            continue
        try:
            key, value = l.split('=', 1)
            d[key] = value.strip()
        except __HOLE__:
            pass
dataset/ETHPy150Open coreemu/core/daemon/core/misc/utils.py/readfileintodict