A Python extension to run C code in Python
Project description
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
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
pyc4-1.0.1.tar.gz
(13.3 kB
view details)
File details
Details for the file pyc4-1.0.1.tar.gz
.
File metadata
- Download URL: pyc4-1.0.1.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b118475ea660baf23aa71b66519d8730f06ded42ff7c27998cd835913d2b341f |
|
MD5 | 31c6db59d3ea2434f881a6f2bcf0e003 |
|
BLAKE2b-256 | 8f20891b59fa62d01820d36c73347f98ea247a5e359c0e981276ae93028a9580 |