Python中print(

xiaoxiao2021-02-28  117

作用

输出文件开头注释的内容

推广

1)momodule.py

"""This is the module docstring.""" def f(x): """This is the function docstring.""" return 2 * x

2)执行

>>> import mymodule >>> mymodule.__doc__ 'This is the module docstring.' >>> mymodule.f.__doc__ 'This is the function docstring.'

参考资料

print(doc) in Python 3 script

转载请注明原文地址: https://www.6miu.com/read-51137.html

最新回复(0)