Skip to content

davidnk/pyC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

pyC

Run C code from a python string.

Notes

  • Requires gcc

Example

from pyC import runC
funcs = """
void f1() {
    printf("f1");
}
void run(int n) {
    int i;
    for (i = 0; i < n; i++) {
        f1();
    }
}
"""
r = """
printf("Running...");
run({});
"""
imports = ['<stdio.h>']
output = runC(funcs, r.format(10), imports)
print output
# Running...f1f1f1f1f1f1f1f1f1f1

About

Run C code from a python string

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages