Skip to content

Forked from pancho111203/vscode-ipython. IPython extension for VSCode

Notifications You must be signed in to change notification settings

wan230114/vscode-ipython-run

Repository files navigation

Ipython Run 使用文档

注:后来开发过一个 Send To Terminal ,个人认为将更加适用多场景。


使用示例

(示例中,设置了用户快捷键 ctrl+enter 作为命令 ipython.sendSelectedToIPython 的启动。)


工具简介

鸣谢:

功能简介:

  • 将活动窗口的文本发送到ipython运行,可以配合markdown快速书写python文档。

个性化修改:

  • 设置可选:在ipython运行代码后,是否设置直接返回聚焦于文档的编辑窗口。
  • 设置可选:运行时在ipython初始化中是否自动加载进入到编辑文件所在文件夹去运行(可方便读取不同级文件夹文件)。
  • 设置可选:是否通过使用ipython的命令%load -r直接将选择内容相关发送至ipython终端,否则仅发送选择文本内容。
  • 设置可选:发送前可以选择是否自动保存,此选项配合ipython语法load的使用。
  • 设置可选:发送后是否让光标自动切换到下一行,方便更为快捷 文件-->终端 的交互。

使用方法

当前它包括两个命令:

  • ipython.sendFileContentsToIPython: 会将完整的文件内容发送到打开的ipython实例中(如果没有打开,则发送一个新的实例)
  • ipython.sendSelectedToIPython: 将选定的行或光标所在的行发送到打开的ipython实例(如果没有打开,则发送新的行)

限制:

  • 只有一个ipython实例可以工作,不能同时有多个。因此特别需要注意,在切换文件使用时,对于环境变量的控制。

更新日志Changelogs


v0.6.2 (2021-02-08)

修复BUG

  • 修复更新 vscode January 2021 (version 1.53) 后无法正常使用的BUG。

功能优化

  • 选中状态下,不自动跳转下一行。

v0.6.1 (2020-08-30)

BUG修复

  • 更新功能选项的说明及README文档。
  • 修复ipython命令# %load后,会多进行一行换行的BUG。

v0.6.0 (2020-08-30)

功能新增

  • 增加可选选项,发送前可以选择自动保存,以配合ipython语法load的使用。
  • 增加可选选项,发送后光标自动切换到下一行,方便更为快捷的交互。

v0.5.7 -- v0.5.9

界面及描述优化

  • 使用方法的动画制作
  • 更新文字语言描述
  • 更新及美化图标

v0.5.6 (2020-03-30)

BUG 修复

  • 修复了有关末尾输入\n时终端无法自动执行的问题。

v0.5.5 (2020-03-27)

BUG 修复

  • 修复输入ipython后因加载超时不运行的问题。

v0.5.4 (2020-03-27)

功能新增

  • 设置可选设置:是否使用ipython从文件读取行的命令%load -r直接将选择内容相关直接发送至ipython终端,否则直接发送选择内容。

v0.5.3 (2020-03-27)

功能新增

  • 设置可选设置:运行后可以设置直接返回文档编辑窗口
  • 设置可选设置:可直接将选择内容直接发送至ipython终端


Ipython Run documentation


Usage example

(In the example, the user shortcut key ctrl+enter is set as the start of the command ipython.sendSelectedToIPython.)


Tool Introduction

Thanks:

Function introduction:

  • Send the text of the active window to ipython to run, and you can quickly write python documents with markdown.

Personalized modification:

  • Optional setting: whether to set to directly return to the editing window focused on the document after running the code in ipython.
  • Optional setting: whether to automatically load into the folder where the edited file is located during the initialization of ipython during runtime to run (it is convenient to read files in different folders).
  • Optional setting: Whether to directly send the selected content to the terminal of ipython by using the command %load -r of ipython, otherwise only the selected text content will be sent.
  • Optional setting: You can choose whether to save automatically before sending. This option is used with the ipython syntax load.
  • Optional setting: Whether to make the cursor automatically switch to the next line after sending, which is convenient and quicker to interact with File-->Terminal.

Instructions

Currently it includes two commands:

  • ipython.sendFileContentsToIPython: will send the complete file content to the opened ipython instance (if not opened, send a new instance)
  • ipython.sendSelectedToIPython: Send the selected line or the line where the cursor is located to the opened ipython instance (if it is not open, then send a new line)

Limit:

  • Only one ipython instance can work, not multiple instances at the same time. Therefore, special attention should be paid to the control of environment variables when switching files.

Changelogs


v0.6.2 (2021-02-08)

Fix BUG

  • Fix the bug that vscode cannot be used normally after updating vscode January 2021 (version 1.53).

Function optimization

  • When selected, do not automatically jump to the next line.

v0.6.1 (2020-08-30)

BUG fix

  • Update the description of the function options and the README document.
  • Fix the bug that after the ipython command # %load, there will be one more line wrap.

v0.6.0 (2020-08-30)

New features

  • Add optional options, you can choose to automatically save before sending to match the use of ipython syntax load.
  • Add optional options, the cursor will automatically switch to the next line after sending, which is convenient and faster for interaction.

v0.5.7 - v0.5.9

Interface and description optimization

  • How to use animation
  • Update text language description
  • Update and beautify icons

v0.5.6 (2020-03-30)

BUG fix

  • Fixed the problem that the terminal cannot be executed automatically when \n is entered at the end.

v0.5.5 (2020-03-27)

BUG fix

  • Fix the problem that ipython does not run due to loading timeout after inputting ipython.

v0.5.4 (2020-03-27)

New features

  • Set optional settings: whether to use the command %load -r to read lines from the file using ipython to directly send the selected content directly to the ipython terminal, otherwise directly send the selected content.

v0.5.3 (2020-03-27)

New features

  • Set optional settings: After running, you can set and directly return to the document editing window
  • Set optional settings: you can send the selected content directly to the ipython terminal

About

Forked from pancho111203/vscode-ipython. IPython extension for VSCode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published