python中readline的用法

readline

问题:


(.env) [root@cd tmp]# python
Python 2.7.10 (default, Jul  4 2017, 17:45:34)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time^[[D^[[D^[[D
  File "<stdin>", line 1
    import time
               ^
SyntaxError: invalid syntax
>>> ^[[A^[[A^[[A^[[B^[[B
  File "<stdin>", line 1
    ^
SyntaxError: invalid syntax
>>>

无法回退,无法上翻,下翻....

安装 readline

(.env) [root@cd tmp]# pip install readline

安装 readline 之后:

(.env) [root@cd tmp]# python
Python 2.7.10 (default, Jul  4 2017, 17:45:34)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> import time

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音。了解发音是有意...
    萤火虫de梦阅读 100,037评论 9 468
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 176,016评论 25 709
  • 今天早上我接到了建设银行的一个电话反馈,因为前两天上课没有接听客服的电话。两周前因为我电话中答应了建行工作人员的分...
    蓝文迪阅读 1,171评论 0 0
  • 明月,天涯,是否深知与妄意 一方,与分致深,巧巧过火 冽日,仰军漂衫,步闻似尥洒 助身助莫,以不得峰低,首尔瓣未河
    什梦想阅读 1,877评论 0 0

友情链接更多精彩内容