stdout redirection issues #588
Labels
p3-enhancement 🔥
Much new such feature
question/docs ‽
Documentation clarification candidate
to-review 🔍
Awaiting final confirmation
There are several issues with the example of the DummyTqdmFile in the readme:
file = None
in the class makes it a class level variable, rather than object level. It should be removed or changed to__slots__ = ("file",)
.redirect_stdout
(Python 3.4+) andredirect_stderr
(Python 3.5+) incontextlib
might be nice for people using those versions of Python.tdqm.write
does not behave like a normal.write
, it adds a\n
.This causes lots of issues with this overwrite, especially inside nested progress bars. I worked on this a while, and could not get the redirect to work and produce the correct override.EDIT: I forget to add
file=sys.stdout, dynamic_ncols=True
, that solved 4.Here's an example of the updated example with fixes for several of the points above:
Note that the final progress bar covers up the prompt if
leave
is not set toFalse
.The text was updated successfully, but these errors were encountered: