From bbc19c7619c1c7904e8c5ec1ef9c785350729c6c Mon Sep 17 00:00:00 2001 From: Caihui Date: Sun, 28 Jun 2020 23:01:47 -0700 Subject: [PATCH] Force the buffer to flush after each print The info of print() is first output to the buffer and will not be printed if the buffer is not full. Use flush() to force the buffer to flush after each print Change-Id: I548962fb43043e4b9991892d354aed192aebf7c1 --- freezer/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freezer/main.py b/freezer/main.py index c01f975c..d93adf4b 100644 --- a/freezer/main.py +++ b/freezer/main.py @@ -175,7 +175,9 @@ def run_job(conf, storage): pp.field_names = response[0] for i in response[1]: pp.add_row(i) - print(pp) + sys.stdout.writelines(pp.get_string()) + sys.stdout.write('\n') + sys.stdout.flush() else: return