>>^[[C^[[D"等字样. 但在非virtualenv环境的Python Sh"/> >>^[[C^[[D"等字样. 但在非virtualenv环境的Python Sh">

Python Shell 中敲击方向键显示「^[[C^[[D」,原因是什么?如何修复?

WBOY
Release: 2016-06-06 16:03:49
Original
1485 people have browsed it

系统环境: OS X 10.8
Python: version 2.7.5, built from source, isolated by virtualenv.
问题描述: 通过"source bin/active"进入virtualenv环境后, 在Python Shell中敲击方向键, 会出现">>>^[[C^[[D"等字样. 但在非virtualenv环境的Python Shell(系统自带版本, 源码构建版本)中并不会出现这种现象. 我想知道为什么会出现这样的问题, 以及如何修复.
PS: 小白问题, 才疏学浅, google无果后上来求教.
====================================================
Stackoverflow上有类似的问题:

  • input - Python shell: Arrow keys do not work on remote machine
  • How to repeat last command in python interpreter shell?
Python Doc: 2. Using the Python Interpreter
====================================================
感谢@吴涛的回答, 我基本知道从哪里入手解决这个问题了, 但是我的情况可能更加复杂一点, 原因可能与codecs这个package有关, 问题是在使用这个库之后才出现的, 与 python - Arrow keys in Putty returning [[A^ [[D^ [[B^ instead of moving the cursor 的描述可能有关联.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template