使IPython3的行为类似于Python3的`type`

时间:2015-09-04 13:07:41

标签: python-3.x ipython

使用IPython3考虑以下内容:

Python 3.4.3+ (default, Jul 28 2015, 13:17:50) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: type([1,2])
Out[1]: list

与Python3相同的代码:

Python 3.4.3+ (default, Jul 28 2015, 13:17:50) 
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> type([1,2])
<class 'list'>

如何调整IPython以使其显示与“纯”Python3相同的输出?

1 个答案:

答案 0 :(得分:0)

需要停用漂亮的打印:

%pprint