def mem_test():
    for dirpath, dnames, fnames in scandir.walk(restorePaths[0]):
        for f in fnames:
            if 'DIR.EDB' in f or 'PRIV.EDB' in f:
                with open(os.path.join(dirpath, f), 'rb') as f:
                    yield f.read(1)
results = [x for x in mem_test()]
Read a single byte from large file