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
File details
Details for the file sphinxcontrib-pyexec-0.0.3.tar.gz
.
File metadata
- Download URL: sphinxcontrib-pyexec-0.0.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb41d7e68ab05e9375a927fe243358f50dceda36b21ddfb0306af1bd6128e499 |
|
MD5 | e65d562d71139b0f5d436ed07302db24 |
|
BLAKE2b-256 | d3077fd51dda50e52a6c5e9d836c4524ae5a596f83c0329f31aae39088a5c446 |