def qprogress(s):
 global _last_prog
 now = time.time()
 if ((now - _last_prog) > 0.1):
  progress(s)
  _last_prog = now

def qprogress ( s ) : global _last_prog now = time . time ( ) if ( ( now - _last_prog ) > 0.1 ) : progress ( s ) _last_prog = now
calls progress() only if we havent printed progress in a while .