Imagine a text file of 20 mb. I am reading char by char and extracting the useful information. I have actually 2 main functions, one is reading the file and the second is extracting the info. Something like this:
def reader(path):
f = open(path, 'r')
source = f.read()
f.close()
while True:
# here is where I read char by char and call the function extractor
def extractor(s):
# here I extract the useful information
Now, my goal is to continue to read while extractor is working. So basicaly, my question is what is the appropriate way to accomplish my goal?