问题标签 [ipython]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2311 浏览

alias - 在 IPython 中,如何为 %magics 创建别名?

假设我想为 %edit -x 创建别名 %xed。我该怎么做?

0 投票
3 回答
13372 浏览

python - Emacs 23 和 iPython

有没有人使用带有 emacs 23 的 iPython?emacs wiki 上的文档有点混乱,我很想听听任何使用 emacs 进行 Python 开发的人的意见。你使用下载的python-mode和ipython.el吗?你有什么建议吗?

0 投票
5 回答
9746 浏览

python - 如何强制 iPython 使用旧版本的 Python?

我正在运行 Ubuntu 8.10,使用 Python 2.5 开箱即用。从系统的角度来看这很好,但我需要 Python2.4,因为我在 Zope / Plone 上开发。

好吧,安装 python2.4 没有挑战,但我找不到让 iPython 使用它的(干净的)方法:man 和配置文件中都没有选项。

之前,有一个 ipython2.4 包,但它已被弃用。

0 投票
3 回答
5805 浏览

python - 如何使用 IPython 作为我的 Emacs Python 解释器?

我在 OS X 上运行 Emacs 22.1.1 和 IPython 0.9.1,我希望能够在 IPython 解释器中按需从我当前的缓冲区运行 Python 代码的行/方法/片段。

我需要做什么才能使它正常工作?

0 投票
4 回答
4456 浏览

python - Advice regarding IPython + MacVim Workflow

I've just found IPython and I can report that I'm in deep love. And the affection was immediate. I think this affair will turn into something lasting, like the one I have with screen. Ipython and screen happen to be the best of friends too so it's a triangular drama. Purely platonic, mind you.

The reason IPython hits the soft spots with me are very much because I generally like command prompts, and especially *nix-inspired prompts with inspiration from ksh, csh (yes, chs is a monster, but as a prompt it sport lots of really good features), bash and zsh. And IPython does sure feel like home for a *nix prompt rider. Mixing the system shell and python is also a really good idea. Plus, of course, IPython helps a lot when solving the Python Challenge riddles. Invaluable even.

Now, I love Vim too. Since I learnt vi back in the days there's no turning back. And I'm on Mac when I have a choice. Now I'd like to glue together my IPython + MacVim workflow. What I've done so far is that I start Ipython using:

Thus when I edit from IPython it starts MacVim with the file/module loaded. Could look a bit like so:

OK. I think this can be improved. Maybe there's a way to tie IPython into MacVim too? Please share your experiences. Of course if you use TextMate or some other fav editor I'm interested too. Maybe some of the lessons are general.

0 投票
3 回答
2088 浏览

python - 如何让 IPython 按类组织选项卡完成的可能性?

当一个对象有数百个方法时,tab 补全很难使用。有趣的方法通常是被检查对象的类而不是其基类定义或覆盖的方法。

如何让 IPython 对其选项卡完成可能性进行分组,以便检查对象的类中定义的方法和属性首先出现,然后是基类中的方法和属性?

它看起来像未记录的inspect.classify_class_attrs(cls)功能以及inspect.getmro(cls)为我提供了我需要的大部分信息(这些最初是为了实现 python 的help(object)功能而编写的)。

默认情况下 readline 按字母顺序显示完成,但用于显示完成的函数可以替换为 ctypes 或 Python 2.6 及更高版本包含的 readline 模块。我已经覆盖了 readline 的完成显示并且效果很好。

现在我需要的只是一种将每个类信息(从inspect.*上面)与每个实例信息合并的方法,按方法解析顺序对结果进行排序,漂亮的打印和分页。

为了获得额外的功劳,最好存储选择的自动完成,并在下次尝试对同一对象进行自动完成时首先显示最受欢迎的选择。

0 投票
4 回答
58962 浏览

python - 如何检查 iPython 中对象的内存使用情况?

我正在使用 iPython 来运行我的代码。我想知道是否有任何模块或命令可以让我检查对象的内存使用情况。例如:

类似%memusage <object>并返回对象使用的内存。

复制

找出 Python 中的对象正在使用多少内存

0 投票
2 回答
2503 浏览

python - 无法将 iPython 设置为使用 2.6.1 Python

我已经在 Mac 中安装了最新的 iPython。但是,它使用 Python 版本 2.5.1。

我在这里通过 MacPython 包安装了 Python 2.6.1 。

如何让我的 iPython 使用 Python 2.6.1?

我不确定 MacPython 包在哪里安装了最新的 Python。最新的Python 应该以某种方式放置 PATH以便 iPyhon 可以使用它。

[编辑]在第一个答案之后

我运行以下命令

我无法通过以下方式打开 python2.6

0 投票
1 回答
1058 浏览

ipython - 无法设置 IPython 默认登录 shell

我通过 MacPorts 将 IPython 安装到我的 Mac 上。我可以通过$ IPython运行它,而不是作为登录 shell。

我试图找到 IPython 的目录,然后我可以将其放入终端的设置中,但未成功

即使通过 whereis 我也没有找到它。

如何将 IPython 设置为默认登录 shell?

0 投票
4 回答
3746 浏览

python - 如何配置 IPython 以在 Windows 上使用 gvim?

这看起来确实像是我应该能够在 Google 上找到的东西,但由于某种原因,我无法确定它的正面或反面。有 EDITOR 环境变量、ipy_user_conf.py 文件、ipythonrc 文件、在服务器模式下运行 gvim 的一些奇怪的事情以及一堆我无法理解的其他东西(可能是因为缺乏睡眠)。

是否有我可以遵循的指南,或者也许有人可以概述我需要采取的步骤?