accounts = dict()
data = open(filename)
for line in data.readline():
    info = line.split('LOG:')
if len(info) == 2:
    a, b = info
try:
    accounts[a].add(True)
except KeyError:
    accounts[a] = set()
accounts[a].add(True)
How to free memory after opening a file in Python