Closed parchd-1 closed 6 years ago
Hi there, yeah, somehow the automatic output detection does not work reliably on some machines anymore -- not sure what it is, but I have to look at it some time to see if there's a better way to do it ...
In the meantime, what should always work, is setting the stderror stream for pyprind manually, so that you can redirect the stdoutput (e.g,. as produced from your program) to a log file. For example, if your script looks like that:
import pyprind
import sys
pbar = pyprind.ProgBar(10, stream=sys.stderr)
for i in range(10):
print('hello')
pbar.update()
then you can run it as
python somescript.py > scriptoutput.txt
This should show the progressbar on the command line but redirect the program's output (here 'hello') to the file.
Thanks hey. your answer to the above comment worked perfect on my machine
Thanks for the note, I think we can close this issue now :)
In pyprind 2.9.8 it was possible to redirect stdout to a file and still see the progress from pyprind. Since 2.9.9, the progress doesn't show when redirecting stdout. Instead, a message is output to stdout:
I have only just upgraded to 2.10 directly from 2.9.8, so I hadn't noticed this before.
The problem can be seen by simply running the following as
python pyprind_bug.py > output_file