In some codes like MCMC
it lasts for hours and maybe days to finish.
Now I am wondering how can see the outputs which are saving in a text file
while Python is running. Because in my code checking the whole outputs in txt file
is possible only after finishing the Python's work
def ....():
return
def ....():
return
......
with open('outputs/p.txt', 'w') as f:
.....
f.write("{0}\t{1}\n".format(A,B))
with this code, I can only see the outputs after finishing the python running. But it is beneficial if we can check it every time we want.