Execute code in autodoc docstring
问题 When using Sphinx and autodoc to document a Python project, you can use :Example: to include a code sample in your module/class/function docstring, which Sphinx will kindly syntax highlight for you. Something like so. >>> rng = Range(0, 1000) >>> rng [0, 1000) >>> len(rng) 1000 >>> rng.start = 500 >>> rng.start 500 >>> rng.end 1000 >>> I copied and pasted this from the Python interpreter. Is there any way to have Sphinx or autodoc execute the code and capture the output automatically for the