Re: SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread Matthieu Brucher
Boost.Python is difficult to understand, far more than SWIG. It may be faster, but I don't think it is worth it ATM. Binding C++ classes with SWIG is really simple. Matthieu 2008/11/25 Olivier Grisel <[EMAIL PROTECTED]>: > 2008/11/25 <[EMAIL PROTECTED]>: >> On Nov 25, 4:34 pm, "Diez B. Roggisch"

Re: [Python-Dev] Why don't range and xrange threat floats as floats?

2008-11-05 Thread Matthieu Brucher
2008/11/5 L V <[EMAIL PROTECTED]>: > Why don't range and xrange threat floats as floats? > Is there any good reason range and xrange don't threat floats as floats but > as integers? > When I enter float arguments in a range, the floats are treated as integers. > (+ some warning) > > This is how I t

Re: [ANN]pygccxml - 1.0

2008-10-23 Thread Matthieu Brucher
2008/10/23 M.-A. Lemburg <[EMAIL PROTECTED]>: > On 2008-10-23 09:20, Matthieu Brucher wrote: >> Hi, >> >> I'm trying to use your package, but the gccxml installer is not >> available from your website anymore. Is it possible for you to upload >

Re: [ANN]pygccxml - 1.0

2008-10-23 Thread Matthieu Brucher
2008/10/23 Roman Yakovenko <[EMAIL PROTECTED]>: > On Thu, Oct 23, 2008 at 9:20 AM, Matthieu Brucher > <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I'm trying to use your package, but the gccxml installer is not >> available from your website anymor

Re: [ANN]pygccxml - 1.0

2008-10-23 Thread Matthieu Brucher
Hi, I'm trying to use your package, but the gccxml installer is not available from your website anymore. Is it possible for you to upload it again ? Thanks, Matthieu 2008/10/20 Roman Yakovenko <[EMAIL PROTECTED]>: > Hello! > > I'm pleased to announce the 1.0 release of pygccxml. > > What is pyg

Re: QT, ctypes dll and SEG Faults

2008-08-17 Thread Matthieu Brucher
Hi, If the crash occurs in __init__, why do you give us more code ? The crash can occur because you pass a char* to your library. This char* is not managed by your library but by Python. This means that when the constructor is finished, the string is freed and the char* is not valid anymore. Thi

Re: .cpp to .pyd

2008-08-07 Thread Matthieu Brucher
> I think that my MS visual studio cannot find "boost python", if > that's the problem then can you tell me how can I solve it. > This is very begginer question,but I can't find answer nowhere, and I > don't have any expirience with Microsoft products. Hi, Put Boost in your include path (options

Re: Python Written in C?

2008-07-23 Thread Matthieu Brucher
2008/7/23 mk <[EMAIL PROTECTED]>: >> Actually, all of the compilers I'm familiar with (gcc and a >> handful of cross compilers for various microprocessors) >> translate from high-level languages (e.g. C, C++) into >> assembly, which is then assembled into relocatable object >> files, which are then

Re: sage vs enthought for sci computing

2008-07-08 Thread Matthieu Brucher
2008/7/8 three3q <[EMAIL PROTECTED]>: > Hi, > >>> If my goal >>> is to replace matlab (we do signal processing and stats on >>> physiological data, with a lot of visualization), would sage or >>> enthought get me going quicker? > Pylab. Not a good idea, as pylab will be replaced by pyplot which on

Re: Threads, GIL and re.match() performance

2008-06-26 Thread Matthieu Brucher
Hi, The C-API uses references counts as well, so it is not threadsafe. Matthieu 2008/6/26 Pau Freixes <[EMAIL PROTECTED]>: > But Python C-API[1] it's the main base for extent python with C/c++, and > this is not not threadsafe.? I dont understand > > [1] http://docs.python.org/api/api.html > > O

Re: Platform independent code?

2008-06-14 Thread Matthieu Brucher
Hi, Python is a platform independent language, period. You can always excute a Python script with python script.py. Now, with Windows, you can execute the script by doucle-clicking on it. With Linux, it's different, you have to use the shebang line to execute a script with the correct interpreter.

Re: How to make py2.5 distutil to use VC2005?

2008-06-05 Thread Matthieu Brucher
2008/6/4 甜瓜 <[EMAIL PROTECTED]>: > Howdy, >This problem have puzzled me for a long time. I usually use > python2.5 in Windows, while VC2005 is installed. > However python25.lib is compiled by VC2003. When I use disutil to > build some C extensions, it complaints that > there is no VC2003. >

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Matthieu Brucher
2008/6/5 Russ P. <[EMAIL PROTECTED]>: > On Jun 5, 12:20 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > > > All somebody has to do to get at the private data is: > > > > #define private public > > # include > > #undef private > > Well, that shows the weakness of the C/C++ header files. The "include" >

Re: should I put old or new style classes in my book?

2008-05-30 Thread Matthieu Brucher
2008/5/29 Alan Isaac <[EMAIL PROTECTED]>: > This thread raises two questions for me. > > > > 1. I take it from this thread that in Python 3 the > > following are equivalent: > > > > class Test: pass > > > > class Test(object): pass > > > > Is that correct, and if so, where is it stated

Re: should I put old or new style classes in my book?

2008-05-29 Thread Matthieu Brucher
Hi, New style classes should be put as the default. This is what I did, based on the principle that new classes were introduces in Python 2.2 and that we are now at 2.5 and soon 2.6. Tutorials that use old style classes may be old and perhaps won't be updated ever. That's not a problem. Just tell

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-21 Thread Matthieu Brucher
2008/5/21 Dave Parker <[EMAIL PROTECTED]>: > On May 21, 2:44 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > My understand is no, not if you're using IEEE floating point. > > Yes, that would explain it. I assumed that Python automatically > switched from hardware floating point to multi-precisi

Re: Struct usage and varying sizes of h, l, etc

2008-05-21 Thread Matthieu Brucher
> > This is all true if you want to operate in "native" mode; however in > "standard" mode the sizes are fixed -- otherwise there'd be no easy way of > reading/writing the fixed-size fields in many common file formats. > > As the manual says: > """ > Native size and alignment are determined using t

Re: Python library for clustering from distance vector

2008-05-18 Thread Matthieu Brucher
Hi, You should send your question on the scipy user ML. If you use a distance between objects, you can try the kmeans (implemented in scipy), if you use similarities, you can change them to dissimilarities and use the same function. Matthieu 2008/5/18 Sengly <[EMAIL PROTECTED]>: > Dear all, > >

Re: Python and Flaming Thunder

2008-05-18 Thread Matthieu Brucher
2008/5/15 John Salerno <[EMAIL PROTECTED]>: > On Tue, 13 May 2008 06:25:27 -0700 (PDT) > Dave Parker <[EMAIL PROTECTED]> wrote: > > > > I'm pretty generally interested, but where can print layout take you? > > > > Not far, especially with books disappearing. Our library says that > > these days,

Re: help compiling Python on vs 2008!

2008-05-17 Thread Matthieu Brucher
2008/5/17 Christian Heimes <[EMAIL PROTECTED]>: > Matthieu Brucher schrieb: > > Hi, > > > > I did not manage to build extension with distutils with Python compiled > with > > VS different than 2003. The need for 2003 was hard-coded in distutils. > > Y

Re: help compiling Python on vs 2008!

2008-05-17 Thread Matthieu Brucher
Hi, I did not manage to build extension with distutils with Python compiled with VS different than 2003. The need for 2003 was hard-coded in distutils. You can try building extensions with VS2008 with Scons. This is what I do a lot, and everything works fine as long as the interface does not use s

Re: writing python extensions in assembly

2008-05-16 Thread Matthieu Brucher
> > yeah I don't know much about that, I was figuring perhaps I could limit > the > assembler parts / methodology to something I could write generically > enough.. and if all else fails write for the other OS's or only support > windows. also I think I should be using SIMD of some sort, and I'm

Re: Python and Flaming Thunder

2008-05-13 Thread Matthieu Brucher
So does every other compiler like gcc or interpreters like Python. What is your point ? Matthieu 2008/5/13 Dave Parker <[EMAIL PROTECTED]>: > > Notice that I said "free software", not "*** FREE *** software > > 1!" (that is, free as in freedom, not free as in beer). Read again my > > answe

Re: Python and Flaming Thunder

2008-05-13 Thread Matthieu Brucher
> > Perhaps. But if elementary school students can easily understand why > one programming language gives the answer 100 (Flaming Thunder): > > Write 10^2. > > but can't understand why another programming language gives the answer > 8 (Python): > > Print 10^2 > > then I think the comparison move

Re: Some error messages in Python are ugly

2008-05-11 Thread Matthieu Brucher
Please, really please, stop asking question and go read some books about/get some courses on Linux shell and then finally Python. Before you do that, the only thing will have is upset people telling you to _think_ (clearly that's something you are n,ot used to do, but you will have to start at some

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-11 Thread Matthieu Brucher
2008/4/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > This question was posed to me today. Given a C/C++ program we can clearly > embed a Python interpreter in it. Is it possible to fire up multiple > interpreters in multiple threads? For example: > > C++ main > thread 1 >

Re: Graphs in Python

2008-04-10 Thread Matthieu Brucher
Hi, Did you try packages dedicated to graphs, like NetworkX ? Matthieu 2008/4/10, Sanhita Mallick <[EMAIL PROTECTED]>: > > Hi. > > I am a newbie to Python. I am trying to implement a > Python code for graph manipulation. My graphs are > about 200-500 nodes big. Excepting for the short basic > gr

Re: SWIG/C++

2008-04-10 Thread Matthieu Brucher
Hi, The error is generated because you are asking for a u8*, but the buffer is not a u8*, perhaps a char* or even a void*. If you change the method signature to either char* or void*, it may work like you want it to ;) Matthieu 2008/4/10, Bill Davy <[EMAIL PROTECTED]>: > > Is there a better plac

Re: [Python-Fr] Réflexions sur l'auto complétion dans les éditeurs Python...

2008-04-10 Thread Matthieu Brucher
Le 10/04/08, Jul <[EMAIL PROTECTED]> a écrit : > > Bonjour à tous, > > L'un des problèmes des éditeurs de code Python est qu'il ne proposent pas > d'autocomplétion "intelligente", c'est à dire en cohérence avec l'objet en > cours de frappe. La plupart des éditeurs se basent sur des fichiers texte >

Re: ANN: pry unit testing framework

2008-04-06 Thread Matthieu Brucher
2008/4/5, Aldo Cortesi <[EMAIL PROTECTED]>: > > Thus spake Matthieu Brucher ([EMAIL PROTECTED]): > > > > How does it compare to the nose framework ? > > > As far as the base unit testing functionality is concerned, I think > they try to address similar prob

Re: [Python-Fr] "keyword arguments" en français

2008-04-05 Thread Matthieu Brucher
J'appelle ça les arguments nommés (parfois en anglais on parle de named argument). Je pense que tu parles des arguments donnés dans les **kwargs, c'est ça ? On parle aussi d'arguments formels, par opposition aux arguments positionnels lors d'un appel directement à une fonction : pour machin(0, x=1)

Re: ANN: pry unit testing framework

2008-04-05 Thread Matthieu Brucher
2008/4/5, Aldo Cortesi <[EMAIL PROTECTED]>: > > Thus spake Kay Schluehr ([EMAIL PROTECTED]): > > > > But you could have added the integration of code coverage and other > > helpful features with unittest as a conservative extension giving > > everyone a chance to use it directly with existing tests

Re: what does ^ do in python

2008-03-25 Thread Matthieu Brucher
Hi, In most of the languages ^ is used for 'to the power of'. > No, not in most languages. In most languages (C, C++, Java, C#, Python, Fortran, ...), ^ is the xor operator ;) Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and h

Re: using PIL for PCA analysis

2008-02-21 Thread Matthieu Brucher
Hi, You should convert your data to numpy and make it 1D (for the moment, it is 3D) by calling the ravel() method. Then you can create your covariance matrix ;) Matthieu 2008/2/21, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > hi guys > i am trying out PCA analysis using python.I have a set of > j

Re: OpenOpt install

2007-12-18 Thread Matthieu Brucher
it means that the whole scikit architecture must be rethought. Matthieu 2007/12/18, Matthieu Brucher <[EMAIL PROTECTED]>: > > Hi, > > My solution was the correct way to go, IIRC, only a few changes were to be > done so that those files were detected correctly (I think there we

Re: OpenOpt install

2007-12-18 Thread Matthieu Brucher
Hi, My solution was the correct way to go, IIRC, only a few changes were to be done so that those files were detected correctly (I think there were some __init__.py files that were not present this may have to do with the fact that you add a lot of additional paths in sys.path when you load openop

Re: Python too complex ?!?!?!

2007-11-17 Thread Matthieu Brucher
> > > The gui is an issue. Does one TK or rely on some fall-back system of > > gnome/kde/x11/windows dialogue boxes (ending in abject failure by way of > > raw_input on the command line)? Or (perhaps) have it fetch a standard > > dialogue library which would fetch and install what is needed for fut

Re: Python Design Patterns - composition vs. inheritance

2007-11-17 Thread Matthieu Brucher
> > > >Well, you would if you override the two set_* methods to set both > > > height and width to the same value > > > > But that breaks expectations: a user doesn't expect set_width() to > affect > > the height. > > I can't speak for everyone but I certainly expect setting the width of > a S

Fwd: Python Design Patterns - composition vs. inheritance

2007-11-15 Thread Matthieu Brucher
Sorry for the double post -- Forwarded message -- From: Matthieu Brucher <[EMAIL PROTECTED]> Date: 15 nov. 2007 23:38 Subject: Re: Python Design Patterns - composition vs. inheritance To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> 2007/11/15, [EMAIL PROTEC

Re: How do I get the PC's Processor speed?

2007-11-06 Thread Matthieu Brucher
> > Executing the CPUID instruction may be helpful if you can figure out how > these guys are using it: > http://www.cpuid.com/cpuz.php > Numpy has an interface for this function. Matthieu -- French PhD student Website : http://miles.developpez.com/ Blogs : http://matt.eifelle.com and http:/

Re: how to convert tuple to a "list of single values" ?

2007-10-28 Thread Matthieu Brucher
Use : something = self._point2ClientCoord (p1, p2 ) dc.SetClippingRegion (*something) Matthieu 2007/10/28, stef mientki <[EMAIL PROTECTED]>: > > hello, > > The next piece of code bothers me: > > ptx, pty, rectWidth, rectHeight = self._point2ClientCoord (p1, p2 ) > dc.SetC

Re: Read Matlab files with Python and Numeric?

2007-10-26 Thread Matthieu Brucher
Scipy proposes such a module. Matthieu 2007/10/25, QAM <[EMAIL PROTECTED]>: > > Hi Travis, > > > > Could you please send me the matlab reader you mentioned? > > > > Thanks, > > > > Frank > > -- > http://mail.python.org/mailman/listinfo/python-list > -- French PhD student Website : http://mil

Re: sqlite and TemporaryFile under Windows

2007-10-17 Thread Matthieu Brucher
> > Besides the fact that database management systems need lots of > random file accesses? That doesn't imply not supporting file-object. BTW, how is it possible to close the access to the database ? I deleted the object but Winows tells me that someone is still holding the file. Matthi

Re: sqlite and TemporaryFile under Windows

2007-10-16 Thread Matthieu Brucher
> > > Obviously it cannot, but what are the reason it can't ? > > I have no idea. > > > Well, I could, but in this case I have to delete the file myself, which > > the whole point of the use of TemporaryFile. > > Go with the flow dude! Unless you want to solve the issue by delving in > to the sourc

Re: easy but difficult

2007-10-16 Thread Matthieu Brucher
Hi, Use write() instead of print Matthieu 2007/10/16, Beema shafreen <[EMAIL PROTECTED]>: > > hi everybody, > I have a file separated by hash: > as shown below, > file: > A#1 > B#2 > A#2 > A#3 > B#3 > > I need the result like this: > A 1#2#3 > B 2#3 > > how will generate the result like this

Re: sqlite and TemporaryFile under Windows

2007-10-15 Thread Matthieu Brucher
> > > If this is the way of using sqlite, it is still cumbersome as a lot of > > other classes that work on files can work on file-like (and isn't it the > > whole point of Python ;) ? > > I don't think that sqlite can work on streams, or on file-like objects. Obviously it cannot, but what are t

Re: sqlite and TemporaryFile under Windows

2007-10-15 Thread Matthieu Brucher
> > Are you aware that you can do an in-memory database (IOW no file at all)? > > cur = sqlite.connect(":memory:") > Yes, but in this case, how can I use the DB that I downloaded from the net ? If this is the way of using sqlite, it is still cumbersome as a lot of other classes that work on files

sqlite and TemporaryFile under Windows

2007-10-15 Thread Matthieu Brucher
Hi, I want to create a temporary database that is downloaded for the net. So I want to use a temporary file that will be deleted at the end of my program. For this, I wanted to use tempfile.TemporaryFile. The problem with Windows is that I can't give to sqlite3.connect() the file neither can I giv