TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Reactive Jupyter- reactive execution of Python in VSCode

8 点作者 Micoloth大约 1 年前
Hi HN<p>I’ve developed an experimental VSCode extension to keep a Python Kernel in sync with a Python file. (Reactive execution)<p>The extension uses Static Code Analysis to infer dependencies between lines of code.<p>When you modify a line in a file, it will be marked as Stale together with all the lines that depend on it. You can Sync the state with Ctrl+Shift+Enter. In this way, you are always in control.<p>See the Readme for a detailed demo.<p>—-------------<p>The primary limitation of this extension is that it currently relies on Static Code Analysis, which can only do so much. Again, see the Readme for a discussion.<p>This extension is also in PREVIEW. I’m sure there are bugs around. Both in the Static Code Analysis of more obscure Python idioms (even though it’s pretty robust for the simple ones), and in the interaction with the VsCode APIs (lots of edge cases there).<p>—-------------<p>The intended use cases are machine learning, data analysis, scientific computing or any other application that requires scripting or exploratory coding.<p>The most popular setup for these is Jupyter Notebooks, and this extension could be expanded to work with Notebooks too.<p>On the other hand, right now it is very much built around my personal favourite for these workflows.<p>I’ve used Jupyter Notebooks many times, but I’ve never quite liked them for the following reasons:<p>- For the editing experience, nothing really beats a plain Python file. I want to select, copy, and paste all the code I want anywhere, without Cells getting in my way.<p>- Having an output on every cell produces lots of clutter anyway. For most cells, I want to run them once, keep the code there just in case, but don’t run them again.<p>- And then of course, the Reactivity problem: when you modify a cell, there is usually no way to rerun the affected code only.<p>The VSCode Interactive Window makes for a great setup for 1 and 2. My extension fixes 3.<p>—-------------<p>I’ve wanted to have this extension for years.<p>Only now it became possible thanks to a cool new VsCode Jupyter feature, i.e. the ability to send code from an extension directly to a running Python kernel.<p>Even though I’ve developed this primarily for myself, I’d love to know what you think about it!

暂无评论

暂无评论