python箭头向下怎么变,当我在Python解释器中按向上或向下箭头键时,会得到^ [[A或^ [[B而不是历史记录?...

用户在使用Python 2.7.2版本时遇到无法通过上下箭头调用历史命令的问题,在Ubuntu 10.04环境下,尝试解决此问题的方法包括重新安装libreadline-dev并重新编译Python。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I have no idea why history won't work in the Python 2.7.2 interpreter. I get strange character groups for each of the arrow keys. This doesn't happen in Terminal. BTW I am on Ubuntu 10.04. Here is a screen shot of this hell:

ba19237b14dc4c7d262777ab491d0b5b.png

How do I get back the ability to get my command history by pressing the Up and Down Arrow keys?

解决方案

It looks as if you're using a build from source. It looks like you'll need to rebuild Python after installing the libreadline-dev or equivalent package on your distribution.

Update: There should be no special build steps needed, just running make should do. There are some messages printed at the end about optional modules which couldn't be built because of missing dependencies (in addition to readline, there are also Tcl/Tk, zlib, gdbm and openssl dependencies, for example).

If for some reason just running make doesn't work, try running configure again first (if make doesn't already run it for you).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值