import time from backup_monitoring.parsing.parsers import bperror as parser file = open('test.txt', 'r') stream = parser.stream(file) i = 0 for record in stream: i += 1 print i instance = parser.parse(record) print instance.message time.sleep(1) file.close()