Skip to main content

pwcp

Python with C preprocessor

Installation

pip install pwcp

Running

pwcp <file>

pwcp -m <module>

Or run built-in code module to start interactive console:

pwcp -m code

Run pwcp -h for more options.

Why?

For fun! And for YABI.

How to use it?

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.

Extension for header files?

Suggested extension is .pyh (python header), but technically you can use whatever you like.

What about comments?

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.

Does it work with pure Python?

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.

Metadata

Release files for pwcp 0.13.0

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

Source distribution (sdist)

Source distribution for pwcp 0.13.0
File Size Uploaded
pwcp-0.13.0.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pwcp 0.13.0
File Interpreter ABI Platform
pwcp-0.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.6 kB

Release files / pwcp-0.13.0.tar.gz

Download URL pwcp-0.13.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7d9128dba6a1806009b30550820a3188d38dbbfe8db7426e4a9af9fa10d25835
BLAKE2b-256 checksum
How to use checksums
f4ab25edaa9abf829bb9223667e5cb3be9e17dc1db6add825b8c3d64607e463f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release files / pwcp-0.13.0-py3-none-any.whl

Download URL pwcp-0.13.0-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f52c746ed8573b351f5dd39d4be62cd07850d8260f77ec186179c48ca85abbc
BLAKE2b-256 checksum
How to use checksums
d24334c114015098f22209e7f78719217fd5369bbcea674cba87f2281f84f487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.13.0 This release

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

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