IPython shell的换行问题 [英] Line-wrapping problems with IPython shell

查看:611
本文介绍了IPython shell的换行问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在IPython中运行了很长的一行,并尝试在当前行的开头之外调用它(使用向上箭头)或退格,则显示不正确(全部被刷成一行)

If I have run a long line in IPython, and try and recall it (using the up-arrow) or backspace beyond the start of the current line, it displays incorrectly (all smushed into one line)

例如,在下面的会话中我写了一个长行 [1] ,输入了一个空白的行 [2] ,然后向上箭头两次以获取 [3] [3] print 语句$ c>,发生以下情况:

For example, in the following session I wrote a long line [1], entered a somewhat-blank line [2], then up-arrowed twice to get the print statement on line [3], and the following happened:

在iTerm和Terminal.app中都有发生。我在常规终端会话中遇到了类似的问题,通过正确终止颜色代码来修复,但是我我不知道如何用IPython修复它

Happens in both iTerm and Terminal.app.. I had a similar problem with regular terminal sessions, which was fixed by properly terminating colour codes, but I'm not sure how to fix it with IPython

推荐答案

啊哈!我有一个旧版本的Python readline模块 - 从 http://ipython.scipy.org/dist安装最新版本/ 它完美无缺!

Aha! I had an old version of the Python readline module - installing the latest from http://ipython.scipy.org/dist/ and it works perfectly!

sudo easy_install http://ipython.scipy.org/dist/readline-2.5.1-py2.5-macosx-10.5-i386.egg

这篇关于IPython shell的换行问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆