tqdm icon indicating copy to clipboard operation
tqdm copied to clipboard

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

Open lrq3000 opened this issue 9 years ago • 8 comments

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...

lrq3000 avatar May 28 '16 21:05 lrq3000

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).

hildogjr avatar Feb 24 '18 14:02 hildogjr

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

casperdcl avatar Feb 24 '18 16:02 casperdcl

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 avatar Feb 24 '18 16:02 hildogjr

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?

hildogjr avatar Mar 21 '18 00:03 hildogjr

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 avatar Mar 21 '18 00:03 casperdcl

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

casperdcl avatar Mar 21 '18 00:03 casperdcl

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.

chigkim avatar Mar 11 '24 20:03 chigkim

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.

hildogjr avatar Mar 11 '24 20:03 hildogjr