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

Jupyter notebook #5

Open
PietropaoloFrisoni opened this issue Feb 17, 2022 · 3 comments
Open

Jupyter notebook #5

PietropaoloFrisoni opened this issue Feb 17, 2022 · 3 comments

Comments

@PietropaoloFrisoni
Copy link

Hello,

is there a way in order to make this nicely compatible with jupyter notebook?

I am calling some C++ functions from jupyter with python and in the terminal the progress bar is displayed nicely, but on the terminal the result is very strange (see pictures).

Is there an "easy" way to solve this?

Thank you and congratulations!
ju_comp
term_comp

@PietropaoloFrisoni
Copy link
Author

edit: the statement above of course should be: "in the (shell) terminal the progress bar is displayed nicely, but in the jupyter cell the result is very strange"

@gipert
Copy link
Owner

gipert commented Feb 19, 2022

Hi Pietropaolo, unfortunately I don't use Jupyter notebooks myself. I'm afraid I cannot help you... If you discover something, a pull request would be highly appreciated. Thanks for reporting and good luck.

@xloem
Copy link

xloem commented Aug 7, 2022

I'm guessing that this request comes from experience with https://github.com/tqdm/tqdm , which is well-used in both python and jupyter notebooks, and has produced a common culture of attaching a progress meter to everything. I came here from tqdm.

I looked into tqdm's source code, and unfortunately it appears to craft progress meters for jupyter notebook using html and calls out to the ipython backend to display the html as python objects. This is harder to do from a subprocess written in C++, because the ipython environment with its various variables is not present.

There's information on the communications protocol at for example https://jupyter-client.readthedocs.io/en/stable/messaging.html ; however, I think it might make more sense for the changes here to happen in python, which already has direct access to ipython, using some way to process the terminal formatting characters.

For example, this already exists: https://github.com/adamj9431/notebook_xterm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants