if I'm in the python console and I want to see how a particular module works, is there an easy way to dump the source?
views:
48answers:
3this dumps the content of any file.
Kugel
2010-01-13 07:59:43
+1
A:
Using IPython, you can do this:
In [1]: import pyparsing
In [2]: pyparsing.Word??
...and the source will be displayed, if possible. I guess this must use inspect under the hood, but the added convenience of ? / ?? is fantastic.
Michał Marczyk
2010-01-13 07:50:40