Skip to main content

pyc4

A Python extension to run C code in Python based on c4.

Install

pip install pyc4

Use

The first argument is the code the rest are the argv

>>> import c4
>>>
>>> c4.execute(r"""
... int main() {
...     printf("hi\n");
...     return 0;
... }
... """)
hi
0
>>> c4.execute(r"""
... int main(int argc, char **argv) {
...     printf("%s\n", argv[0]);
...     return 1;
... }
... """, "hi")
hi
1

Metadata

Release files for pyc4 1.0.1

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

Source distribution (sdist)

Source distribution for pyc4 1.0.1
File Size Uploaded
pyc4-1.0.1.tar.gz 13.3 kB Details

Release files / pyc4-1.0.1.tar.gz

Download URL pyc4-1.0.1.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b118475ea660baf23aa71b66519d8730f06ded42ff7c27998cd835913d2b341f
BLAKE2b-256 checksum
How to use checksums
8f20891b59fa62d01820d36c73347f98ea247a5e359c0e981276ae93028a9580
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

1 release file

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