The directive runpython runs a python script and insert the output in the documentation.
.. runpython:: import sys print(sys.version_info)
Every printed information is added to the documntation :
sys.version_info(major=3, minor=6, micro=1, releaselevel='final', serial=0)
Two intersections options :
extensions = ['sphinx.ext.intersphinx', ... 'pyquickhelper.sphinxext.sphinx_runpython_extension']
One example (in French) : demo runpython. The second one shows how I use to build content (still French): rendering and source.
<-- --> |