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
Feature Request: Notebook to script #3732
Comments
I like this, but if you only do this for a single cell the created module will typically not work as there are globals in the notebook (set by previous cell runs). There should preferably be some smartness added to either warn if the cell relies on other cells somehow, and maybe required imports, top-level objects, and the like could even be automatically added to the export. |
I imagine a naive implementation that simply treated the cell contents as text would be good enough for 80% of purposes, and it would certainly avoid a LOT of complex analysis that would be required to add the "smartness," which could be provided by a later enhancement if necessary. Cross-process drag and drop seems like a pretty complicated and platform-dependent feature, TBH. |
I agree with @holdenweb that actually populating the session with imports, variables, etc would be prohibitively complex (especially since we support order 100 kernels). That being said, I think that drag-drop for cell contents into a text editor would be very doable (perhaps for an advanced beginner). |
What about https://github.com/jupyter/nbconvert ? |
What would that do that "File | Download as | Python" wouldn't? |
Wait, it already exists, you are right. My bad. (File -> export as -> executable script) |
Small quality of life feature request. We can already drag & drop from one notebook to another notebook. However, it would be awesome if you could drag a cell from a notebook into the text editor and have it populate that cell's script into the editor. Don't know if this is possible, but I like to think of my notebook as a checklist of sorts. When a function for a module is done being prototyped, I like getting it out of my sight so to speak.
The text was updated successfully, but these errors were encountered: