Is there an option to print the output of help(\'myfun\'). The behaviour I\'m seeing is that output is printed to std.out and the script waits for user input (i.e. type \'q\
>>> x = 2
>>> x.__doc__
'int(x[, base]) -> integer\n\nConvert a string or number to an integer, if possi
ble. A floating point\nargument will be truncated towards zero (this does not i
nclude a string\nrepresentation of a floating point number!) When converting a
string, use\nthe optional base. It is an error to supply a base when converting
a\nnon-string. If the argument is outside the integer range a long object\nwill
be returned instead.'
Is that what you needed?
edit - you can print(x.__doc__)
and concerning the function signature, you can build it using the inspect
module.
>>> inspect.formatargspec(inspect.getargspec(os.path.join))
'((a,), p, None, None)'
>>> help(os.path.join)
Help on function join in module ntpath:
join(a, *p)
Join two or more pathname components, inserting "\" as needed