显示IPython变量而不使用whos输入 [英] Display IPython variables without entering using whos
问题描述
有没有办法查看当前工作区中的IPython变量列表,而无需发送命令'whos'。在键入命令时,我经常发现自己不记得要使用的变量名称。
Is there a way to view a list of the IPython variables currently in the workspace without having to send the command 'whos'. I often find myself not remembering what variable names I want to use while typing a command.
在IPython中,我必须删除当前输入的行并发送'whos'语句以查看当前可用的变量。通常,在基于GUI的工具(如MATLAB)中,我只会在我的工作区变量窗口右侧查看。
In IPython, I have to erase the current line I was typing and send a 'whos' statement to see which variables are currently available. Normally, in GUI based tools like MATLAB I would just look to the right at my Workspace Variable window.
推荐答案
正如其他人所说,你可以在同一个Ipython内核中拥有尽可能多的前端,例如一个内核的2个命令窗口。如果你使用Qt控制台,快捷方式可以让你接近你想要的。
As others said, you can have as many frontends as you like on the same Ipython kernel, i.e 2 command windows for one kernel for example. If you are using the Qt console, shortcuts can get you close to what you want.
用 Ctrl + Shift + T启动第二个带有相同内核的选项卡即可。
然后你只需在第一个标签上编写代码,当你需要输出 whos
时,按 Ctrl + PageDown 转到其他选项卡,您可以运行 whos
而不删除第一个选项卡中的代码。
Start a second tab with the same kernel with Ctrl+Shift+T.
Then you just write your code on the first tab, and, when you need the output of whos
, press Ctrl+PageDown to get to the other tab, and you can run whos
without deleting your code in the first tab.
这篇关于显示IPython变量而不使用whos输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!