I am running a python program on SLURM and I get the print statements only after the run is complete. I want to save the print statements in output file during the running.
I tried the solutions from this link, but did not work in my case. One solution was to use sys.stdout.write()
instead of print()
and the other was to start python interpreter with -u
option. I am using python 2.7. Does anyone have any idea?