1

我可以在查看文档字符串时更改配置文件以自动打印吗?

在下面的 iPython 控制台上对比 6 和 7。

In [6]: zip.__doc__
Out[6]: 'zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)]\n\nReturn a list of tuples, where each tuple contains the i-th element\nfrom each of the argument sequences.  The returned list is truncated\nin length to the length of the shortest argument sequence.'

In [7]: print zip.__doc__
zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)]

Return a list of tuples, where each tuple contains the i-th element
from each of the argument sequences.  The returned list is truncated
in length to the length of the shortest argument sequence.

谢谢。

4

1 回答 1

1

IPython 已经为你做到了。使用?而不是检查__doc__

In [1]: zip?
于 2013-06-12T16:21:05.227 回答