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

[request] Offline version #8

Open
vinniec opened this issue Apr 24, 2019 · 7 comments
Open

[request] Offline version #8

vinniec opened this issue Apr 24, 2019 · 7 comments

Comments

@vinniec
Copy link

vinniec commented Apr 24, 2019

Yesterday I found your extension but following your advice I tried before nbtutor.
I mainly use jupyter-lab but nbtutor worked only in the classic version of jupyter (I think because jupyter-lab lacks the "cell toolbar"), so after I realized that in order not to break the interface I had to use %%nbtutor -i at the beginning of the code cell, I decided to try your extension.

The first thing I liked to notice is that tutormagic also works in jupyter-lab as it is!
Then I looked for information and found that you can start quite simply python tutor offline, here are the steps:

  1. install bottle webserver : sudo -H pip3 install bottle --upgrade
  2. download v5: svn export https://github.com/pgbovine/OnlinePythonTutor/trunk/v5-unity pytut (I used subversion to download the dir but you can simply download the entire repository and use only the "v5-unity" directory)
  3. run pytutor: cd pytut && python3 bottle_server.py (can you try if all work visiting the page http://localhost:8003/visualize.html )
  4. change the line 162 of your /usr/local/lib/python3.6/dist-packages/tutormagic.py in url = protocol + "localhost:8003/iframe-embed.html#code="
    And the magic is ready!

So my request is: please create an offline version including bottle as dependency (100kb) and the subdir v5-unity (25mb) and launch them when load your plugin with %load_ext tutormagic.

The downside is that without any configuration the offline version works only for python, but you could include an "-o/--online" option to use the site instead of the offline version.

Please, please, please! pytutor is perfect in couple with jupyter! ♥

@kikocorreoso
Copy link
Owner

Hi @vinniec

I'll be quite busy until June. So, please, if you're interested on this just comment here after 31st May and I will try to check the possibilities to have an offline version.

@Naereen
Copy link
Contributor

Naereen commented Feb 20, 2021

This issue can be closed, PythonTutor is no longer open-source apparently...
https://github.com/pgbovine/OnlinePythonTutor and https://github.com/pgbovine/ are closed.

@Naereen
Copy link
Contributor

Naereen commented Feb 20, 2021

NO I found a fork, https://github.com/seamile/PyTutor which seems very up-to-date!

@kikocorreoso
Copy link
Owner

Hi @Naereen

What would be the request here?

I think the inclusion of pythontutor/pytutor/bottle is out of the scope of tutormagic.

I don't see myself maintaining a pythontutor fork. If pythontutor is not available and maintained and pytutor is not up to date (e.g., I've tested the py36anaconda and it crashes) then there are few options.

Please, let me know what are the needs to better understand them.

@Naereen
Copy link
Contributor

Naereen commented Feb 22, 2021

Hi,
There wasn't much of a request but more a follow-up on this discussion, with pointers to a "recent" version of PyTutor.

I spent hours yesterday diving in PythonTutor v3/v5 front-end and v4 backends for other languages than Python, as my goal is was to try to add support for OCaml support in PythonTutor... and the C/C++ backend is way too complicated for me, it uses a modified version of Valgrind, so I dropped the idea to port it for OCaml.

But on the other hand, I managed quite easily to use the mentioned PyTutor fork (and here s a fork to preserve it) on my own laptop, to have an offline "backup" version, that I can start with a one-liner-script if needed.

I guess my only question now would be: how can I instruct tutormagic (on my local notebooks) to use my local version of PyTutor (running in like http://localhost:8003/index.html) for the iframes?
This way I can safely use it for my (possibly offline) lessons on Python!

(ideally I think I could try to extend tutormagic so that it'll first try the online version and then fallback to offline locally running version)

@kikocorreoso
Copy link
Owner

kikocorreoso commented Feb 22, 2021

I think it could be quite easy to add an option (e.g. --offline https://localhost:8008) to use a local pytutor.

The docs should be updated to point to the right direction to use this option:

(but the inclusion of a dependency like PythonTutor within tutormagic itself is not realistic as it is complex and I don't have the time these days).

@Naereen
Copy link
Contributor

Naereen commented Feb 25, 2021

Thanks for the instructions, I'll try this out!

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