2013-02-19 44 views
5

如何在IPython中默認啓用漂亮打印?我無法在任何地方找到明確的說明如何做到這一點。 非常感謝!在IPython中默認啓用漂亮打印

+0

它在ubuntu默認啓用。你在用什麼? – 2013-02-19 22:25:30

+1

這[論壇主題](http://grokbase.com/t/scipy.org/ipython-user/12b9kbt2kv/pretty-print-as-default-print-function)與您具有相同的問題。我會查出來的! – xxmbabanexx 2013-02-19 22:34:40

+1

你只是想讓IPython中的'Out [123]:'行做'pprint.pprint(_)'而不是'print(repr(_))',或者是否想要將每個調用都綁定到而不是'print'到'pprint.pprint',或者類似的東西? – abarnert 2013-02-19 23:46:44

回答

3
$ ipython help notebook | grep pprint -A1 
--pprint 
    Enable auto pretty printing of results. 
-- 
--no-pprint 
    Disable auto auto pretty printing of results. 


$ ipython help console | grep pprint -A1 
--pprint 
    Enable auto pretty printing of results. 
-- 
--no-pprint 
    Disable auto auto pretty printing of results.