Re: how to convert 4 bytes into a float ?

2005-02-08 Thread Jean-Baptiste PERIN
Alex Martelli a écrit : Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: I read 4 bytes from a binary file. These bytes represent a floating point number (mantisse exponent form) How can I get a float from these bytes ? See the docs for module struct, specifically the struct.unpack functi

how to convert 4 bytes into a float ?

2005-02-08 Thread Jean-Baptiste PERIN
I read 4 bytes from a binary file. These bytes represent a floating point number (mantisse exponent form) How can I get a float from these bytes ? -- http://mail.python.org/mailman/listinfo/python-list

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 : -

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&

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 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 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 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 &quo

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 &quo

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