Search notes:

Python library: pyexpander

Installing pyexpander

In my case as administrator on Windows:
pip install pyexpander
This also installs the expander.py script under <inst-dir>/Scripts.

Simple example

Here's a file to be preprocessed (test.txt):
first $py(num = 42) line
second $py(txt = 'Hello world') line

This is the fourth line in the output.

The number is $(num) and the text is $(txt).
This file can now be preprocessed to stdout with
C:\users\rene> expander test.txt
This command prints
first  line
second  line

This is the fourth line in the output.

The number is 42 and the text is Hello world.

Index