Python script writes no output when stdout is redirected to a file [duplicate]
If you are using print to output text, its argument flush
might help you:
print('Hello, World', flush=True)
Otherwise:
import syssys.stdout.write('Hello, world\n')sys.stdout.flush()
will have the same effect.