RosettaCodeData/Task/Synchronous-concurrency/Python/synchronous-concurrency-2.py

13 lines
197 B
Python

count = 0
def reader():
for line in open('input.txt'):
yield line.rstrip()
print('Printed %d lines.' % count)
r = reader()
# printer
for line in r:
print(line)
count += 1