跳转到主要内容

pythontutor.com的JupyterLab扩展

项目描述

jupyterlab-pytutor

Extension statusGithub Actions Status JupyterLite Binder

pythontutor.com的JupyterLab扩展。此扩展集成了pytutor,以便Python代码可以通过pytutor进行检查

screenshot of jupyterlab-pytutor

要求

  • JupyterLab >= 3.0

安装

要安装此扩展,请执行

pip install jupyterlab-pytutor

卸载

要移除此扩展,请执行

pip uninstall jupyterlab-pytutor

贡献

开发安装

注意:您将需要NodeJS来构建扩展包。

jlpm命令是JupyterLab随附的yarn的固定版本。您可以使用yarnnpm代替下面的jlpm

# Clone the repo to your local environment
# Change directory to the jupyterlab-pytutor directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build

您可以在不同的终端中同时监视源目录并运行JupyterLab,以便监视扩展源中的更改并自动重新构建扩展。

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

在运行监视命令时,每个保存的更改将立即在本地构建并可供您正在运行的JupyterLab使用。刷新JupyterLab以在浏览器中加载更改(您可能需要等待几秒钟以等待扩展重新构建)。

默认情况下,jlpm run build命令为该扩展生成源映射,以便使用浏览器开发者工具进行调试。要为JupyterLab核心扩展也生成源映射,可以运行以下命令

jupyter lab build --minimize=False

开发卸载

pip uninstall jupyterlab-pytutor

在开发模式下,您还需要删除由 jupyter labextension develop 命令创建的符号链接。要找到其位置,您可以运行 jupyter labextension list 来确定 labextensions 文件夹的位置。然后您可以删除该文件夹中名为 jupyterlab-pytutor 的符号链接。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

jupyterlab_pytutor-0.2.0.tar.gz (96.2 kB 查看哈希值)

上传时间

构建分布

jupyterlab_pytutor-0.2.0-py3-none-any.whl (19.2 kB 查看哈希值)

上传时间 Python 3

由以下组织支持