Re: Is there a nicer way to do this?

2007-10-04 Thread Amaury Forgeot d7;Arc
Hello, Stefan Arentz a écrit : > Is there a better way to do the following? > > attributes = ['foo', 'bar'] > > attributeNames = {} > n = 1 > for attribute in attributes: >attributeNames["AttributeName.%d" % n] = attribute >n = n + 1 > > It works, but I am wondering if there is a more py

Re: Lost in __setstate__() in C++ and swig

2007-09-13 Thread Amaury Forgeot d7;Arc
Hello, Martin Drautzburg a écrit : > I am trying to cPickle/unpickle a C++ extension class with some private > data members. I wrote __getstate__() and __setstate__ in C++ (I have > to, due to the private data). Pickling writes the following file: > > ccopy_reg > _reconstructor >

Re: c macros in python.

2007-05-06 Thread Amaury Forgeot d7;Arc
[EMAIL PROTECTED] a écrit : > Hey, > > I'm writing a script to generate code. I'm a bit tired of typing > outfile.write(). Does python have a way to c-like macros? Every > instance of o(...) in the code will be replaced by outfile.write(...)? First: Python has no macro facility. But in this

Re: howto make Python list from numpy.array?

2007-05-06 Thread Amaury Forgeot d7;Arc
Hello, John Nagle a écrit : > dmitrey wrote: >> howto make Python list from numpy.array? >> Thx, D. >> > > lst = map(None, arr)// for 1D arrays. Which can be expressed more simply as: lst = list(arr) -- Amaury -- http://mail.python.org/mailman/listinfo/python-list

Re: wx and SOAPpy interaction

2007-04-14 Thread Amaury Forgeot d7;Arc
python-list/2006-April/377070.html The problem is that wxWidgets embeds its own copy of expat. You may have to recompile either python or wxWidgets so that they use the same expat version. -- Amaury Forgeot d'Arc -- http://mail.python.org/mailman/listinfo/python-list

Re: help building debug .pyd files

2007-04-11 Thread Amaury Forgeot d7;Arc
should read the file PCBuild/readme.txt. It explains how to build python from source, and has long explanations about the same list of modules you are asking for. And it works: I regularly use the debug build of python for my own projects. -- Amaury Forgeot d'Arc -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting started with Crystal Reports...little help in the far court.

2007-01-08 Thread Amaury Forgeot d7;Arc
Good evening, Mudcat a écrit : > I am not that familiar with Crystal Reports, but having read some other > posts I know that the way to integrate the API with Python is through > the COM interface provide by win32all. > > However, I have been unable to find any other information on how to get > s

Re: I'm having trouble understanding scope of a variable in a subclass

2006-12-28 Thread Amaury Forgeot d7;Arc
Hello, Pyenos a écrit : > Thanks for clarifying the definitions of nested class and > subclass. However, it did not solve my original problem, and I have > redefined my question: > > class Class1: > class Class2: > class Class3: > def __init__(self): > self

Re: for: else: - any practical uses for the else clause?

2006-09-26 Thread Amaury Forgeot d7;Arc
[EMAIL PROTECTED] a écrit : > A very old thread: > http://groups.google.com/group/comp.lang.python/browse_frm/thread/2c5022e2b7f05525/1542d2041257c47e?lnk=gst&q=for+else&rnum=9#1542d2041257c47e > > discusses the optional "else:" clause of the for statement. > > I'm wondering if anyone has ever fo

Re: wxPython: StaticText Event

2006-09-07 Thread Amaury Forgeot d7;Arc
David a écrit : > Plaese look at this simple class. (...code...) > Hovering mouse over the StaticText Control should generate an > EVT_ENTER_WINDOW event like the TextCtrl Control, but it does not happen. > > How can I make the StaticText event working? I quick Google search found the following t

Re: py2exe and libxml

2006-09-04 Thread Amaury Forgeot d7;Arc
Laszlo Nagy a écrit : > > I wrote a little win32 console application that uses libxml2. It is > working fine. If I create an .exe version, I get this error when I try > to start the program: > > Traceback (most recent call last): > File "MyProgram.py", line 3, in ? > File "mylib\item.pyc", li

Re: psyco+webpy

2006-06-26 Thread Amaury Forgeot d7;Arc
a a écrit : >> psyco.cannotcompile(??.GET) this gives an error message > invalid syntax Oh, I assumed that you would replace the ?? by the correct expression. You need to specify the GET function of the class you've written in the file "codepsyco.py" (I don't know the class name. It does not appe

Re: psyco+webpy

2006-06-26 Thread Amaury Forgeot d7;Arc
a a écrit : > hi i tried psyco+webpy > > here is the error that i got > please let me know if any of you has success run psyco+webpy > thanks > > import web, psyco > urls = ( > '/', 'view', > '/add','add' > ) > psyco.full() > psyco.log() > psyco.profile() > > Launching server: http://0.0.0.0

Re: Psyco performance

2006-06-20 Thread Amaury Forgeot d7;Arc
Hello, Gregory Piñero a écrit : > What's the reasoning behind requiring everything to be in functions? > Just curious. You may want to read this: http://psyco.sourceforge.net/introduction.html#differences-with-traditional-jit-compilers Psyco has to run the code at least once to emit code specia

Re: Overriding methods in classes you don't control

2005-03-29 Thread Amaury Forgeot d7;Arc
Alex VanderWoude a écrit : Here's the situation. I'm using wxPython, and I want to make an enhancement in the __init__ method of all the frame classes. The ideal place to do this is in wxFrame.__init__, since any change there will automatically be inherited by the other frame classes (for example,

Re: Overriding methods in classes you don't control

2005-03-29 Thread Amaury Forgeot d7;Arc
Alex VanderWoude a écrit : Here's the situation. I'm using wxPython, and I want to make an enhancement in the __init__ method of all the frame classes. The ideal place to do this is in wxFrame.__init__, since any change there will automatically be inherited by the other frame classes (for example,