homura
homura copied to clipboard
Print progress on one line
I'm running on OS X, and the progress function would print a new line every time it updated. I made this change so that the progress function would update the same line every time, keeping the terminal output cleaner - let me know what you think!
Before this PR
After this PR
@eliLitwack , thanks for PR. I'm not sure how you run the program, but my code detects whether the user is connected to a tty device (e.g. run from your terminal session). If it is tty, it will refresh the line (print one line), otherwise it will print a new line for each one (e.g. when you redirect the output to a file). See https://github.com/shichao-an/homura/blob/master/homura.py#L265
Ah okay - I've been running it from an IDE (PyCharm), so I guess that explains it.
could you change the code of homura to if STREAM.isatty() or 'PYCHARM_HOSTED' in os.environ:
This would detect pycharm correctly as one-line-printable.
I have the same problem as @ellieLitwack