tqdm / tqdm

:zap: A Fast, Extensible Progress Bar for Python and CLI
https://tqdm.github.io
Other
28.26k stars 1.34k forks source link

tqdm_gui.write() in the GUI instead of console? #172

Open lrq3000 opened 8 years ago

lrq3000 commented 8 years ago

tqdm_gui.write() currently outputs text into the console. Maybe it should prints into the GUI, below the figure in a textbox that would autowrap and overflow (have scrollbars)?

I googled a bit, but it will likely be very complicated to do that using only matplotlib (the currently used lib for drawing the GUI). Eg:

A solution would be to encase the matplotlib drawing into a QT window, but then the GUI would depend on QT lib...

hildogjr commented 6 years ago

I use wxPython and I am creating a GUI that use a CLI Python program (and inside it, tqdm). For me, was interesting if possible to easy overload the method / change the output method that tqdm output in a graphical process bar and labels already present in my GUI (to the CLI still work without the GUI, if necessary).

About create a graphical independent process bar for tqdm, it is interesting if could run in different graphical libraries / not depend of more package installations / or, at least, use the default graphical library already provide in Python (Python 2 use TKinter and Python 3, not, if I remember).

casperdcl commented 6 years ago

This should be easier with inheritance in the new architecture which will be in v5.

hildogjr commented 6 years ago

Glad to hear that. I am now working in my GUIDE that intend to use the tqdm. My the software already use the tqdm on CLI version, now, with a "guide layer" for the user I intend to stop print tqdm on terminal and use the scraping_progress.avg_time, 's/'+scraping_progress.unit and scraping_progress.last_print_n,'/',scraping_progress.total to update the guide informations.

hildogjr commented 6 years ago

On version 4, is it possible to overload some class to:

  1. Not print any process bar on terminal;
  2. Overload / replace the update to output the percentage, so I could use to update a GUI process bar;
  3. Use the information completed parts and time to update other graphical element.

Which class or function I have to overload?

casperdcl commented 6 years ago

all of this is do-able as-is, but I'm hesitant because it'll be clunky and have to be upgraded when I (finally) get around to v5...

casperdcl commented 6 years ago

see #494 for hacky parsing of update strings, and tqdm_gui which inherits from tqdm

chigkim commented 5 months ago

I'm using a package that uses tqdm to print progress on console. Is there a way to capture output without modifying the package I'm using, so I can display on gui like WXPython? I searched tqdm inheritance to update gui, but I couldn't find much.

hildogjr commented 5 months ago

I'm using a package that uses tqdm to print progress on console. Is there a way to capture output without modifying the package I'm using, so I can display on gui like WXPython? I searched tqdm inheritance to update gui, but I couldn't find much.

I time ago I wrote this code https://github.com/hildogjr/KiCost/blob/master/kicost/kicost_gui.py, it is not fancy but worked. The tool was mainly CLI and I just wanted to create a gauge of tqdm in the GUI mode. Search by frame.m_gauge_process.SetValue inside ProgressGUI class.