小编use*_*365的帖子

在 Emacs python 模式下执行表达式并打印其值

我使用 Emacs python-mode 和 ipython 作为我的 IDE 来编写 python 代码。Python-mode 提供了一个很好的函数“py-execute-line”来运行一行代码,我将它绑定到键“F7”。

所以对于下面的代码:

cell = "Human" #  Move the cursor to this line and run it by pressing F7
print cell     #  Move the cursor to this line and run it by pressing F7
Run Code Online (Sandbox Code Playgroud)

我可以在 ipython 缓冲区中打印输出。

In [80]: 
In [81]: Human
Run Code Online (Sandbox Code Playgroud)

我想知道是否有更直接的方法来检查没有打印命令的“单元格”的值。类似于将光标移动到变量,按下某个键,然后将值打印在 ipython 输出缓冲区中。

cell = "Human" #  Move the cursor to this line and run it by pressing F7
cell = "Human" #  Move the cursor to "cell" and …
Run Code Online (Sandbox Code Playgroud)

emacs ipython python-mode

5
推荐指数
1
解决办法
561
查看次数

标签 统计

emacs ×1

ipython ×1

python-mode ×1