def on_loop(notifier, counter):
 if (counter.count > 4):
  sys.stdout.write('Exit\n')
  notifier.stop()
  sys.exit(0)
 else:
  sys.stdout.write(('Loop %d\n' % counter.count))
  counter.plusone()

def on_loop ( notifier , counter ) : if ( counter . count > 4 ) : sys . stdout . write ( 'Exit\n' ) notifier . stop ( ) sys . exit ( 0 ) else : sys . stdout . write ( ( 'Loop %d\n' % counter . count ) ) counter . plusone ( )
dummy function called after each event loop .