Documenting python script entry (__name__ == '__main__') using sphinx

后端 未结 1 1139
旧巷少年郎
旧巷少年郎 2021-01-21 15:35

Is there a way, ideally using autodoc, to get sphinx to document a Python script? The section of the script I want documented is the portion protected by:

1条回答
  •  北海茫月
    2021-01-21 16:27

    You should extract the code in that block into a function, with a docstring, and call that function from the block.

    0 讨论(0)
提交回复
热议问题