Re: extending python with a C-written dll

2004-12-21 Thread Scott David Daniels
Jean-Baptiste PERIN wrote: I can already conclude that either I don't know how to use lcc or it doesn't suit my needs .. I plan to first test the cygwin's gcc compiler before goign to MinGW32 MinGW32 is "Minimalist Gnu for Windows -- 32-bit," and _works_ at being ABI compatible with Microsoft's ABI

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
John Machin a écrit : Jean-Baptiste PERIN wrote: Hi, I'm trying to make a windows dll reachable from a python script .. and I'm encountering troubles during link step .. I use "lcc" to compile and link I use python 2.3 under win XP [snip] Here are the errors : - Error c:\...\plu

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
Note that MinGW32 is a tested path for building (free) C extensions. I don't know if anyone has a tested way of using lcc. Yes, very interesting I can already conclude that either I don't know how to use lcc or it doesn't suit my needs .. in both case I have to quickly get rid of it .. before I t

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
Jean Brouwers a écrit : First, you might check the calldll module available here I have one or two things to try before ..but it looks interesting .. thank you very much .. Take a look at Pyrex, it may fit your requirements to access C from Python.

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
Steve Holden a écrit : Jean-Baptiste PERIN wrote: >> error: Python was built with version 6 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. How do you expect to be able to write your own extension if you don't have the environmen

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
That's got nothing to do with Python. You have to compile extensions using a compiler that has an ABI that's compatible with the ABI of the compiler used to compile Python. You appear to be using a binary distribution of Python that was compiled with MSVS 6.0, therefore, you have to compile exten

Re: extending python with a C-written dll

2004-12-20 Thread Fredrik Lundh
John Machin wrote: > By the way, lcc also *appears* to change "...Module3" to "...Module4" :-) $ more Include/modsupport.h ... #define Py_InitModule3(name, methods, doc) \ Py_InitModule4(name, methods, doc, (PyObject *)NULL, \ PYTHON_API_VERSION) ... -- ht

Re: extending python with a C-written dll

2004-12-20 Thread John Machin
Jean-Baptiste PERIN wrote: > Hi, > > I'm trying to make a windows dll reachable from a python script .. and > I'm encountering troubles during link step .. > > I use "lcc" to compile and link > I use python 2.3 under win XP [snip] > Here are the errors : > - > Error c:\...\plug

Re: extending python with a C-written dll

2004-12-20 Thread Jean Brouwers
First, you might check the calldll module available here Take a look at Pyrex, it may fit your requirements to access C from Python. If you do not have these already, you may need the Win32 API e

Re: extending python with a C-written dll

2004-12-20 Thread Steve Holden
Jean-Baptiste PERIN wrote: >> error: Python was built with version 6 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. How do you expect to be able to write your own extension if you don't have the environment to do so in the first

Re: extending python with a C-written dll

2004-12-20 Thread Grant Edwards
On 2004-12-20, Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: > I know it has nothing to do with python .. > It just makes me sad to see that python cannot get rid of Visual Studoi > to be extended. That's got nothing to do with Python. You have to compile extensions using a compiler that has a

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
>> error: Python was built with version 6 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. How do you expect to be able to write your own extension if you don't have the environment to do so in the first place? that error has nothin

Re: extending python with a C-written dll

2004-12-20 Thread Scott David Daniels
Jean-Baptiste PERIN wrote: Hi, I'm trying to make a windows dll reachable from a python script .. and I'm encountering troubles during link step .. I use "lcc" to compile and link I use python 2.3 under win XP Note that MinGW32 is a tested path for building (free) C extensions. I don't know if a

Re: extending python with a C-written dll

2004-12-20 Thread Diez B. Roggisch
> and look at the expected result .. it is far simpler from the python > side view But you have to do all the C-Work! > > I think ctype is uselful when dealing with dll you're not the author of It is useful, if you don't want to write an extension for the extra work that is needed for that - f

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
Diez B. Roggisch a écrit : The fact is that the python interpreter I use is not a standard one It is a python interpreter delivered within a software named Blender. I don't know whether it is possible or not to add ctypes to it ..(I don't even have a python shell to perform the setup) I'm sure it i

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
thanks for your valuable help .. ctypes is not lost for ever ..I'm going to explore a little bit .. it may suit my need in the end .. I had read : http://www.python.org/dev/doc/devel/ext/intro.html and eveything looked so simple in it .. I'm sad to realize that it only works for linux plateform

Re: extending python with a C-written dll

2004-12-20 Thread Diez B. Roggisch
> The fact is that the python interpreter I use is not a standard one > It is a python interpreter delivered within a software named Blender. > I don't know whether it is possible or not to add ctypes to it ..(I > don't even have a python shell to perform the setup) > > I'm sure it is possible to

Re: extending python with a C-written dll

2004-12-20 Thread Grant Edwards
On 2004-12-20, Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: > OK .. ctypes looks great .. and I plan to use it for futur > purposes > > The fact is that the python interpreter I use is not a > standard one It is a python interpreter delivered within a > software named Blender. I don't know wheth

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
Grant Edwards a écrit : On 2004-12-20, Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: I'm trying to make a windows dll reachable from a python script.. FWIW, you can call dll's using the ctypes modules without mucking around in C. There may be performance reasons to build a "real" python module,

Re: extending python with a C-written dll

2004-12-20 Thread Grant Edwards
On 2004-12-20, Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: >>>I'm trying to make a windows dll reachable from a python script.. >> >> FWIW, you can call dll's using the ctypes modules without >> mucking around in C. There may be performance reasons to build >> a "real" python module, but I ha

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
Grant Edwards a écrit : On 2004-12-20, Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: I'm trying to make a windows dll reachable from a python script.. FWIW, you can call dll's using the ctypes modules without mucking around in C. There may be performance reasons to build a "real" python module,

Re: extending python with a C-written dll

2004-12-20 Thread Grant Edwards
On 2004-12-20, Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: > I'm trying to make a windows dll reachable from a python script.. FWIW, you can call dll's using the ctypes modules without mucking around in C. There may be performance reasons to build a "real" python module, but I haven't run acr

extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
Hi, I'm trying to make a windows dll reachable from a python script .. and I'm encountering troubles during link step .. I use "lcc" to compile and link I use python 2.3 under win XP Here's the compile command which seems to work well : - lcclnk