Solve the problem that Jenkins cannot output printing information in real time when executing Python scripts

question:

When using Jenkins shell commandto execute a python script, you will always wait for the script to be executed, and then printprint out the statements in the script at once;

Solution:

Adding it after printthe statement sys.stdout.flush()can achieve the purpose of real-time output.

Guess you like

Origin blog.csdn.net/m0_46829545/article/details/132667812