Visitar URL original
GitHub - donno2048/pyc4: A Python extension to run C code in Python. · GitHub
Skip to content
donno2048Public
forked from rswier/c4

About

A Python extension to run C code in Python.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Python extension to run C code in Python.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages