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
This commit is contained in:
Caihui 2020-06-28 23:01:47 -07:00
parent b9ed1f903b
commit bbc19c7619
1 changed files with 3 additions and 1 deletions

View File

@ -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