Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lrq3000 opened this issue May 28, 2016 · 8 comments
Open

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

lrq3000 opened this issue May 28, 2016 · 8 comments
Labels
p3-enhancement 🔥 Much new such feature

Comments

@lrq3000
Copy link
Member

lrq3000 commented May 28, 2016

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 lrq3000 added the p3-enhancement 🔥 Much new such feature label May 28, 2016
@hildogjr
Copy link

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
Copy link
Member

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

@casperdcl casperdcl added this to the >5 milestone Feb 24, 2018
@hildogjr
Copy link

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
Copy link

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
Copy link
Member

casperdcl commented Mar 21, 2018

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
Copy link
Member

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

@chigkim
Copy link

chigkim commented Mar 11, 2024

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-enhancement 🔥 Much new such feature
Projects
None yet
Development

No branches or pull requests

4 participants