Skip to main content
# PyExec

[![Documentation Status](https://readthedocs.org/projects/sphinxcontrib-pyexec/badge/?version=latest)](http://sphinxcontrib-pyexec.readthedocs.io/en/latest/?badge=latest) [![Build Status](https://travis-ci.org/3ptscience/sphinxcontrib-pyexec.svg?branch=master)](https://travis-ci.org/3ptscience/sphinxcontrib-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

Metadata

Release files for sphinxcontrib-pyexec 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxcontrib-pyexec 0.0.4
File Size Uploaded Provenance Actions
sphinxcontrib-pyexec-0.0.4.tar.gz 4.3 kB Without provenance Details for sphinxcontrib-pyexec-0.0.4.tar.gz

Release files / sphinxcontrib-pyexec-0.0.4.tar.gz

Download URL sphinxcontrib-pyexec-0.0.4.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
306a1481f2eb3f5f9ef274a3b15843c6f77db0b414970b2c2a9ff6ecf22f9a19
BLAKE2b-256 checksum
How to use checksums
8d2dd020aaf5b45b3a7ca316c9c217273be04adda5096b1283ae96dccb9f0dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for sphinxcontrib-pyexec 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file No provenance

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page