ppps Archive
A pre-preprocessor for C and C++ on PyPI: Python written inside marked comments in a C file runs before compilation, and its results are written into the output.
- Role
- Author
- Period
- Mar 2021
- Team
- Solo
- Stack
- Python · C
- Impact
- On PyPI as ppps

What I did
Code generation for C with Python instead of macros. ppps.process_file("src/main.c", "build/ppps/out.c") reads a C file, finds the text between two kinds of marker comments that you choose, runs the first kind as Python statements and the second as expressions, and writes the values of the expressions into the output file. Options decide whether the Python is kept in the output or removed.

