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 --preprocess-unknown-sources -m code

(--preprocess-unknown-sources is necessary because <console> is not a .ppy file)

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.12.4.tar.gz (11.2 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.12.4-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pwcp-0.12.4.tar.gz
Algorithm Hash digest
SHA256 2a985fbf1a7fab9118c450399d5764333410bfb9afe10df48ebef2fcb2986932
MD5 39bba87f28e5557b4dd38152a2ef9734
BLAKE2b-256 b1e2061573c333b4fd837ed69c9b9ea7197e2f339e9ee940c24c43e34a2f45bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pwcp-0.12.4.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.12.4-py3-none-any.whl.

File metadata

  • Download URL: pwcp-0.12.4-py3-none-any.whl
  • Upload date:
  • Size: 10.6 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.12.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a11e2012fd0edaae98ac4671bd26c6f6a57a450dcc104556e2dbd03f1b138d94
MD5 532618b96208cf40b32eea06f1b2b408
BLAKE2b-256 35a085b6496638e1d8518581d122b33966a20df774fae45f3361d9e9e65487f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pwcp-0.12.4-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