From: Ken S. <ksi...@tt...> - 2001-08-29 17:21:07
|
> Now it works like magic! Much a relief from the chore of making extensions. Excellent! Thanks for testing it on Windows! Let me know if you have any suggestions as to how PyInline could be improved or if you know of any other bugs. TTUL Ken > From: "Ken Simpson" <ksi...@tt...> > To: "Changjune Kim" <ju...@no...> > Sent: Thursday, August 30, 2001 1:50 AM > Subject: Re: PyInline Released: Put C source code directly "inline" with your > Python! > > > > Hi, > > You're actually the first person who has ever tried using PyInline on > > Windows -- congratulations! > > > > This patch should fix the problem: > > > > diff -d -u -r1.1 example1.py > > --- example1.py 2001/08/28 17:39:58 1.1 > > +++ example1.py 2001/08/29 16:47:32 > > @@ -3,7 +3,7 @@ > > > > # Test the simplest of C bindings. > > > > -x = C.Builder(code=""" > > +x = C.Builder(code=r""" > > #include <stdio.h> > > void ja(char *str) { > > printf("Just another %s hacker\n", str); > > > > > > > > TTUL > > Ken > > > > > > On Thu, 30 Aug 2001, Changjune Kim wrote: > > > > > Thank you for the wonderful module, but I'm having some problem running it > on > > > Win32. > > > > > > When I run example1.py, I get the following: > > > > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(10) : error C2001: newline in > > > constant > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(11) : error C2001: newline in > > > constant > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(12) : error C2143: syntax > error : > > > missing ')' before '}' > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(22) : error C2065: 'args' : > > > undeclared identifier > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(22) : warning C4047: > 'function' : > > > 'struct _object *' differs in levels of indirection from 'int ' > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(22) : warning C4024: > > > 'PyArg_ParseTuple' : different types for formal and actual parameter 1 > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(23) : warning C4098: 'ja' : > > > 'void' function returning a value > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(27) : warning C4098: 'ja' : > > > 'void' function returning a value > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(30) : error C2061: syntax > error : > > > identifier '_PyInline_2b20b1d415f9c78f6af9b890ff25a82a_Methods' > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(30) : error C2059: syntax > error : > > > ';' > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(30) : error C2059: syntax > error : > > > '[' > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(37) : error C2065: > > > '_PyInline_2b20b1d415f9c78f6af9b890ff25a82a_Methods' : undeclared > identifier > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(37) : warning C4047: > 'function' : > > > 'struct PyMethodDef *' differs in levels of indirection from 'int ' > > > _PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c(37) : warning C4024: > > > 'Py_InitModule4' : different types for formal and actual parameter 2 > > > running build > > > running build_ext > > > building '_PyInline_2b20b1d415f9c78f6af9b890ff25a82a' extension > > > creating build > > > creating build\temp.win32-2.2 > > > creating build\temp.win32-2.2\Release > > > C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox > /MD > > > /W3 /GX -IC:\PYTHON22\Include > /Tc_PyInline_2b20b1d415f9c78f6af9b890ff25a82a.c > > > > /Fobuild\temp.win32-2.2\Release\_PyInline_2b20b1d415f9c78f6af9b890ff25a82a.obj > > > error: command '"C:\Program Files\Microsoft Visual > Studio\VC98\BIN\cl.exe"' > > > fail > > > ed with exit status 2 > > > > > > ----- Original Message ----- > > > From: "Ken Simpson" <ksi...@tt...> > > > Newsgroups: comp.lang.python > > > Sent: Wednesday, August 29, 2001 3:05 AM > > > Subject: PyInline Released: Put C source code directly "inline" with your > > > Python! > > > > > > > > > > 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 > > > > |