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

13 lines
197 B
Python
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
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