Python with C preprocessor
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pwcp-0.12.2.tar.gz.
File metadata
- Download URL: pwcp-0.12.2.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
049066069c9af8a4d2304867446a9dc4a5fec4b693b408ccaaba889cd9eed265
|
|
| MD5 |
4f4ae6119c0acec0610700085ee9ba79
|
|
| BLAKE2b-256 |
43e3f701074bdf3276b0a32cead9d7690ad805c447020bb8abe09908a326d91e
|
Provenance
The following attestation bundles were made for pwcp-0.12.2.tar.gz:
Publisher:
release.yml on solaluset/pwcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pwcp-0.12.2.tar.gz -
Subject digest:
049066069c9af8a4d2304867446a9dc4a5fec4b693b408ccaaba889cd9eed265 - Sigstore transparency entry: 714056582
- Sigstore integration time:
-
Permalink:
solaluset/pwcp@4a980c84ae03b8f39ae51a4a3df265cd9d2482fa -
Branch / Tag:
refs/tags/v0.12.2 - Owner: https://github.com/solaluset
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a980c84ae03b8f39ae51a4a3df265cd9d2482fa -
Trigger Event:
release
-
Statement type:
File details
Details for the file pwcp-0.12.2-py3-none-any.whl.
File metadata
- Download URL: pwcp-0.12.2-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7abf502ac42afd0011a8fae6f1afaced5786f6384f989d2dcac8c10a9969346b
|
|
| MD5 |
84ca82bf221cc6783dfa0a740a34706a
|
|
| BLAKE2b-256 |
9713bcc2e1b2781a024fb7aa0afc2f20ea68d2ffbbb4827b9de096c6aad90f69
|
Provenance
The following attestation bundles were made for pwcp-0.12.2-py3-none-any.whl:
Publisher:
release.yml on solaluset/pwcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pwcp-0.12.2-py3-none-any.whl -
Subject digest:
7abf502ac42afd0011a8fae6f1afaced5786f6384f989d2dcac8c10a9969346b - Sigstore transparency entry: 714056584
- Sigstore integration time:
-
Permalink:
solaluset/pwcp@4a980c84ae03b8f39ae51a4a3df265cd9d2482fa -
Branch / Tag:
refs/tags/v0.12.2 - Owner: https://github.com/solaluset
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4a980c84ae03b8f39ae51a4a3df265cd9d2482fa -
Trigger Event:
release
-
Statement type: