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 integration? #39

Open
ndrewh opened this issue Aug 14, 2024 · 1 comment
Open

jupyter notebook integration? #39

ndrewh opened this issue Aug 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ndrewh
Copy link
Owner

ndrewh commented Aug 14, 2024

It would be wild to somehow be able to use this from a jupyter notebook. It's not clear how this would have to work

  • Option 1: Literally run a jupyter notebook web server from inside the target process (lol). This is a bit tricky because I don't know how many threads jupyter will spawn, but could probably be made to work. The downside is every time you relaunch the process you'd have to refresh your jupyter notebook, I guess
  • Option 2: Somehow build in the ability to launch a process with a p = process(...) line from outside Pyda. This is something I really want to have for a lot of reasons (and which I envisioned for the project from the beginning) but I have no idea how to make it work. The problem is that the entire point of the tool is that your hooks are executed in the same process ("natively" in some sense, without taking an interrupt) -- so how would you use the handle returned by process to install hooks after it has to fork+exec? It just doesn't make any sense. We could make it work outside of a notebook by basically launching pyda normally and passing __file__ as the script and having it call some special entrypoint -- but then all your scripts look weird and unnatural.
@ndrewh ndrewh added the enhancement New feature or request label Aug 14, 2024
@ndrewh
Copy link
Owner Author

ndrewh commented Aug 26, 2024

Option 2: Somehow build in the ability to launch a process with a p = process(...) line from outside Pyda.

This has an increasing appeal to me. We could proxy every p.* call to the other actual process... but this doesn't really allow for hooks to work (the process literally has a separate Python interpreter!). We could also write some sort of hook-forwarding stub but this is going to be incredibly slow. I guess that is conceptually to how GDB works. So we've just devolved into a debugger at that point...

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

No branches or pull requests

1 participant