【发布时间】:2016-07-29 07:14:23
【问题描述】:
(这个问题本质上是this question,但针对的是IPython 5.0版)
我想要 IPython 5.0 的经典提示。
This 问题有助于自定义我的提示。事实上,我发现 IPython 已经为 ClassicPrompts 定义了一个类。
我需要做的就是将以下内容放入一个名为 00-classic-prompts.py 的文件中或 ~/.ipython/profile_default/startup/ 中的某个文件中:
from IPython.terminal.prompts import ClassicPrompts
ip = get_ipython()
ip.prompts = ClassicPrompts(ip)
但不同的提示行仍然呈现为:
>>> print('Hello world!')
Hello world!
>>>
在每个输入提示之前都有一个额外的换行符。我怎样才能删除它?
【问题讨论】: