关于help()
本帖最后由 小伤口 于 2020-12-23 16:15 编辑>>> help(abs)
Help on built-in function abs in module builtins:
abs(x, /)
Return the absolute value of the argument.
>>>
>>> type(help(abs))
Help on built-in function abs in module builtins:
abs(x, /)
Return the absolute value of the argument.
<class 'NoneType'>
各位大佬,俺想请教一下能否将help(abs)下面的 内容变成字符串或列表{:10_245:} import io
from contextlib import redirect_stdout
ffile = io.StringIO()
with redirect_stdout(ffile):
help(abs)
val = ffile.getvalue()
print('帮助信息:\n' + val) hrp 发表于 2020-12-23 17:18
大佬,绝了{:9_232:}
页:
[1]