sphinxcontrib-pyexec
Project description
# PyExec
A sphinx extension for running python code and displaying both the input and
output [sphinx documentation](http://www.sphinx-doc.org/).
In the conf.py add `PyExec` to your extensions.
In the ReStructuredText file, use the `exec` environment
```
.. exec::
print 2 + 2
```
To output python code & the results in your documentation.
```
>> print 2 + 2
4
```
Note that you need to include the `print` statement for the output to be shown. To see it in action, checkout the [Properties documentation](http://propertiespy.readthedocs.io/).
Based on
- https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/code.py
- http://stackoverflow.com/a/18143318/6086999
A sphinx extension for running python code and displaying both the input and
output [sphinx documentation](http://www.sphinx-doc.org/).
In the conf.py add `PyExec` to your extensions.
In the ReStructuredText file, use the `exec` environment
```
.. exec::
print 2 + 2
```
To output python code & the results in your documentation.
```
>> print 2 + 2
4
```
Note that you need to include the `print` statement for the output to be shown. To see it in action, checkout the [Properties documentation](http://propertiespy.readthedocs.io/).
Based on
- https://github.com/sphinx-doc/sphinx/blob/master/sphinx/directives/code.py
- http://stackoverflow.com/a/18143318/6086999
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for sphinxcontrib-pyexec-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b801806f14f10c058503f4d88de3277b61497dd90115eae545df3c015bc59ad3 |
|
MD5 | 4c138130174b5b588180237b4e5db8d4 |
|
BLAKE2b-256 | 3c7b031c2d5bb2eb60b0a3c3a33482b5d187d1d37bef82204587482fe911b79f |