How to prevent this from happening?

2006-04-30 Thread phil_nospam_schmidt
Regarding this expression: 1 << x I had a bug in my code that made x become Very Large - much larger than I had intended. This caused Python, and my PC, to lock up tight as a drum, and it appeared that the Python task (Windows XP) was happily and rapidly consuming all available virtual memory. P

Re: python coding contest

2005-12-25 Thread phil_nospam_schmidt
Tim Hochberg wrote: > No. I have 8 lines and 175 chars at present. And, I expect that's gonna > get beaten. I wasn't going to get into this, but I couldn't resist :). I'm already behind though... 198 characters on 1 line. It's ugly, but it works. -- http://mail.python.org/mailman/listinfo/pyt

Re: HELP: Searching File Manager written in Python

2005-10-11 Thread phil_nospam_schmidt
I don't know about Norton Commander either. But, have you looked at twander? http://www.tundraware.com/Software/twander/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Continuous system simulation in Python

2005-10-08 Thread phil_nospam_schmidt
Nicholas, I have a particular interest in this subject as well. I've also used the Python/Scipy combination, and it is a tantalizing combination, but I found it to be a bit more clumsy than I'd like. Plus, my need for continuous-time simulation is not as great as it has been in the past. That sai

Re: Continuous system simulation in Python

2005-10-07 Thread phil_nospam_schmidt
Nicholas, Have you looked at Octave? It is not Python, but I believe it can talk to Python. Octave is comparable to Matlab for many things, including having ODE solvers. I have successfully used it to model and simulate simple systems. Complex system would be easy to model as well, provided that y

how to use pyparsing for identifiers that start with a constant string

2005-06-14 Thread phil_nospam_schmidt
I am scanning text that has identifiers with a constant prefix string followed by alphanumerics and underscores. I can't figure out, using pyparsing, how to match for this. The example expression below seems to be looking for whitespace between the 'atod' and the rest of the identifier. identifier

How to prevent Tkinter frame resize?

2005-04-21 Thread phil_nospam_schmidt
I am trying to prevent a user from resizing a frame beyond its "natural" size as given by winfo_reqwidth and winfo_reqheight, without any success. Can anyone make any suggestions, based on my code below? Thanks! from Tkinter import * class Table(Frame): def __init__(self, master,

Re: Rotating arbitrary sets of elements within a list

2005-04-08 Thread phil_nospam_schmidt
[EMAIL PROTECTED] wrote: > I'm trying to come up with a good algorithm to do the following: > > Given a list 'A' to be operated on, and a list 'I' of indices into 'A', > rotate the i'th elements of 'A' left or right by one position. Ok, here's what I've got. It seems to work right, but can it be

Rotating arbitrary sets of elements within a list

2005-04-08 Thread phil_nospam_schmidt
I'm trying to come up with a good algorithm to do the following: Given a list 'A' to be operated on, and a list 'I' of indices into 'A', rotate the i'th elements of 'A' left or right by one position. Here's are some examples: A = [a, b, c, d, e, f] I = [0, 3, 4] rotate(A, I, 'left') --> [b, c,

Re: Cooperative methods, was Re: Calling __init__ with multiple inheritance

2005-03-28 Thread phil_nospam_schmidt
Peter Otten wrote: > The problem with that aren't incompatible signatures, but the lack of an > implementation of the reset() method at the top of the diamond-shaped > inheritance graph that does _not_ call the superclass method. That method > could be basically a noop: Ok, now that's cool! Up

Re: Calling __init__ with multiple inheritance

2005-03-28 Thread phil_nospam_schmidt
What if I want to call other methods as well? Modifying your example a bit, I'd like the reset() method call of Child to invoke both the Mother and Father reset() methods, without referencing them by name, i.e., Mother.reset(self). --- class Mother(object): def __init__(self, p

Re: Suggesting a new feature - "Inverse Generators" -- tangential topic

2005-03-26 Thread phil_nospam_schmidt
> The ability to have 'full coroutines', or at least more 'coroutiney > behaviour' than is provided by generators alone, was I think what I was Jordan, This is somewhat off-topic, but perhaps you might be interested in taking a look at the Lua language (http://www.lua.org/). It supports coroutine

Re: Suggesion for an undergrad final year project in Python

2005-02-01 Thread phil_nospam_schmidt
How about a tool that can compute the intersection/union/disjunction of boolean expressions, and return the result as a boolean expression? This is something I've had on my plate for awhile, but haven't been able to get around to doing. As a simple example, assume we have the following expressions

how to access class methods via their name-as-string

2005-01-31 Thread phil_nospam_schmidt
I'd like to be able to look up a method name by passing a string with the method name. I thought I could use self.__dict__ to get at the method names, but as my example shows, this is obviously not working. I've also tried self.__class__.__dict__ without success. Can anyone point me in the right d

Re: Octal notation: severe deprecation

2005-01-13 Thread phil_nospam_schmidt
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > In Mythical Future Python I would like to be able to use any base in > > integer literals, which would be better. Example random syntax: > > > > flags= 2x00011010101001 > > umask= 8x664 > > answer= 10x42 > > addr= 16x0E84 # 16x == 0x > > gunk=