PyInline Released: Put C source code directly "inline" with your Python!
Ken Simpson
ksimpson at ttul.org
Tue Aug 28 14:05:59 EDT 2001
The PyInline module allows you to put source code from other
programming languages directly "inline" in a Python script or
module. The code is automatically compiled as needed and then loaded
for immediate access from Python.
In short, PyInline lets you do things like this:
from PyInline import C
import __main__
# Let's put some C code "inline" with our Python:
x = C.Builder(code="""
#include <stdio.h>
void ja(char *str) {
printf("Just another %s hacker\n", str);
}
""", targetmodule=__main__) # Add C methods to the __main__ module.
x.build()
ja("Inline")
---
PyInline is the Python equivalent of
Brian Ingerson's Inline module for Perl (http://inline.perl.org),
which was awarded the "Best Module" award at this year's Perl
Conference.
More information about PyInline can be found at the PyInline home page
on
SourceForge:
http://pyinline.sourceforge.net
To discuss PyInline further, please join the pyinline-discuss mailing
list at
http://lists.sourceforge.net/lists/listinfo/pyinline-discuss
More information about the Python-list
mailing list