Re: [Tutor] inheriting different builtin types

2009-02-05 Thread Willi Richert
Hi, http://objectmix.com/python/710201-dynamically-changing-base-class.html may be of interest. wr On Mittwoch, 4. Februar 2009 14:27:17 spir wrote: > Hello, > > I have a strange problem and cannot see a clear method to solve it. > I would like to build a custom type that is able to add some in

Re: [Tutor] Writing a Configuration Facility for an Application

2009-01-30 Thread Willi Richert
Hi, I have often found that just initializing all the necessary stuff in one Configuration.py module. You just import it and it works. If you like the Windows .ini format, ConfigParser is your friend (http://docs.python.org/library/configparser.html). Regards, wr On Freitag, 30. Januar 2009 1

Re: [Tutor] non-greedy matching

2009-01-30 Thread Willi Richert
Hi, you make it non-greedy with "?": import re text="axa axa" greedy_x, greedy_y = re.match("a.*a", text).span() print text[greedy_x:greedy_y] non_greedy_x, non_greedy_y = re.match("a.*?a", text).span() print text[non_greedy_x:non_greedy_y] Will print out: axa axa axa Regards, wr On Freitag,

Re: [Tutor] traceback

2009-01-15 Thread Willi Richert
til a stack frame is found that is handling an exception." Maybe you are actually in two different threads? Take also a look at http://pbe.lightbird.net/traceback-module.html Regards, wr Am Donnerstag, 15. Januar 2009 11:54:50 schrieb spir: > Le Wed, 14 Jan 2009 21:19:11 +0100, > &g

Re: [Tutor] traceback

2009-01-14 Thread Willi Richert
Hi, do you observe the same behavior with traceback.format_exc()? I've used that always in such situations which worked all the time. Regards, wr Am Mittwoch, 14. Januar 2009 18:09:51 schrieb spir: > Hello, > > I rather often use exceptions as information providers at design or debug > time. A

[Tutor] Test code organization

2006-03-09 Thread Willi Richert
Hi, for some time I try to find the best test code organization. I've come up with the following solution, which I guess is not optimal. Please comment. In the code directory there is a special tests directory, which contains all the unit test files. There is the file alltests.py which collect

[Tutor] Test code organization

2006-03-09 Thread Willi Richert
asses()]) if __name__ == '__main__': unittest.main() == What smalls badly is the sys.path.append() stuff every test file must have. Improvements? Thanks for any comment, wr -- Gruss, wr -- Dipl.-Inform. Willi Richert C-LAB - Cooperativ

Re: [Tutor] Strange IndexError

2005-06-14 Thread Willi Richert
ame = ''): ... Thanks for any clarification, wr Am Dienstag, 14. Juni 2005 01:03 schrieb Danny Yoo: > On Mon, 13 Jun 2005, Willi Richert wrote: > > I used the same Pyro code, but this time with the release versions of > > player and stage. This time python crashed w

Re: [Tutor] Strange IndexError

2005-06-13 Thread Willi Richert
() from /lib/tls/libc.so.6 Is this Python-related or some other application's problem? wr Am Donnerstag, 2. Juni 2005 21:00 schrieb Danny Yoo: > On Thu, 2 Jun 2005, Willi Richert wrote: > > my app is a Pyrobot (http://emergent.brynmawr.edu/~dblank/pyro/) > > simulati

Re: [Tutor] Strange IndexError

2005-06-02 Thread Willi Richert
ones that solve the IndexError ;-) Regards, wr Am Mittwoch, 1. Juni 2005 19:09 schrieb Danny Yoo: > On Wed, 1 Jun 2005, Willi Richert wrote: > > in my code I get in rare occasions an IndexError which is > > incomprehensible to me in that situation, where I do a simple > > com

[Tutor] Strange IndexError

2005-06-01 Thread Willi Richert
Hi, in my code I get in rare occasions an IndexError which is incomprehensible to me in that situation, where I do a simple comparison: NeedBrain.py:233: RuntimeWarning: tp_compare didn't return -1 or -2 for exception self._isNearMarker = self._markerDist < self.STAY_MIN_DIST Traceback (most