Re: [Tutor] Subclassing vs. stand alone functions

2007-06-15 Thread Jorgen Bodde
Hi, Basically you write a (sub)class when you want to preserve state information of your instance. If the functionality in question lives longer then the scope of the function, and will be called from different methods to obtain the same information and state of the functionality at that time, it

[Tutor] Calling private base class methods

2007-04-12 Thread Jorgen Bodde
Hi All, Now that I am really diving into Python, I encounter a lot of things that us newbies find difficult to get right. I thought I understood how super() worked, but with 'private' members it does not seem to work. For example; >>> class A(object): ... def __baseMethod(self): ...

Re: [Tutor] skipping ahead within a loop

2007-03-15 Thread Jorgen Bodde
Maybe use a while loop? y = 0 while y < HEIGHT: linewidth = random(3,9) y += linewidth Regards, - Jorgen On 3/15/07, Clay Wiedemann <[EMAIL PROTECTED]> wrote: > If doing a loop, how can one skip forward a specific amount randomly > determined within the loop? > Below is a boiled down ve

[Tutor] Load DLL / library and run a thread from it

2007-01-05 Thread Jorgen Bodde
Hi Guys, I want to make a C++ DLL that spawns a thread, and wrap this with Python so that a thread still runs inside the DLL, but I can access methods to communicate with it, and preferrably receive callbacks from it. I searched the net for examples explaining concepts like this, but I am lost. I

[Tutor] COM and Python

2006-12-14 Thread Jorgen Bodde
Hi All, I am investigating how to use Python and COM to provide a unit testing framework for our low level COM classes. All examples I see cover something like automation but I think my situation is a bit more different. For example, we have a COM class Called "Common" which has IPatient, IName e

Re: [Tutor] WXPython Listbox Problem

2006-12-06 Thread Jorgen Bodde
Try ID's higher then 1 ... low ID's are usually taken by wxWidgets. To be safe simply create them with wx.ID_ANY (from the top of my head) and after that: self.box1.Bind(wx.EVT_LISTBOX, self.b1func,id=self.box1.GetId()) Which is a bit more dynamic anyway and saves you some constants. Further