[python] Usage of sys.stdout.flush() method