def readfile(filename, encoding='windows-1251'):
    """
    Reading file and moving it into dictionary
    
    filename - existing file
    encoding - encoding of given file 
    """
    out = dict()
    with open(filename, encoding=encoding) as settings_file:
        for line in settings_file:
            line = line.rstrip()
            if line[:1] != '#' and len(line) > 0:
                key, value = line.split('=', 1)
                out[key] = value.rstrip()
    return out
