Python with C preprocessor
pip install git+https://github.com/solaluset/pwcp
pwcp <file>
pwcp -m <module>
Or run built-in code
module to start interactive console:
pwcp -m code
For fun!
The extension for files that need to be preprocessed is .ppy
(pre-python).
You can start by creating hello.ppy
and putting there something like
#define hello "Hello "
#define world "world!"
print(hello world)
Then run it
~ $ pwcp hello.ppy
Hello world!
Congratulations! You've run your first program with PWCP.
Suggested extension is .pyh
(python header), but technically you can use whatever you like.
The suggested way to write comments in .ppy
(and .pyh
) files is /* comment */
//
is not a comment as it's floor division in Python and #
indicates preprocessor directives.
Of course. It works like an extension allowing you to run and import .ppy
files. You can import .ppy
file in .py
file and vice versa.
Feel free to submit an issue if something doesn't work.