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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pwcp-0.13.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pwcp-0.13.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file pwcp-0.13.0.tar.gz.

File metadata

  • Download URL: pwcp-0.13.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pwcp-0.13.0.tar.gz
Algorithm Hash digest
SHA256 7d9128dba6a1806009b30550820a3188d38dbbfe8db7426e4a9af9fa10d25835
MD5 644865a25e411f615ea3ff2ee5f2e4fa
BLAKE2b-256 f4ab25edaa9abf829bb9223667e5cb3be9e17dc1db6add825b8c3d64607e463f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pwcp-0.13.0.tar.gz:

Publisher: release.yml on solaluset/pwcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pwcp-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: pwcp-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pwcp-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f52c746ed8573b351f5dd39d4be62cd07850d8260f77ec186179c48ca85abbc
MD5 a6d04b3206bb2ea2bb6321f7f4060f88
BLAKE2b-256 d24334c114015098f22209e7f78719217fd5369bbcea674cba87f2281f84f487

See more details on using hashes here.

Provenance

The following attestation bundles were made for pwcp-0.13.0-py3-none-any.whl:

Publisher: release.yml on solaluset/pwcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page