DEBUG = False def log(message, *args): if DEBUG: print message.format(*args) def main(): x = 0 for i in range(2000): x += i log('hello', x*100) main()