A python package to preprocess text files with embedded Python code snippets: evaluate or execute them and replace with the result of evaluation/execution.
This package provides the ppp.py
script. The script reads the file specified in the command line, finds python snippets, evaluates or executes them and writes out the file with the pyhton code replaced with the evaluateion/execution result.
The following example shows a template file (i.e. the file to be processed with ppp.py) and the result.
Template (test/t1.t) | Resulting file (test/t1.res.t) |
---|---|
|
|
The package is published on PyPI: https://pypi.org/project/twps/. The preffered way to install is:
>pip install twps
For command line options see readme.rst
in the twps
folder or run the script without command line arguemnt.
General description with examples (somewhat outdated) can be found in the docs
folder.