Re: if __name__ == 'main':

2007-03-20 Thread Patrick Down
On Mar 20, 11:49 am, "gtb" <[EMAIL PROTECTED]> wrote: > Hi, > > I often see the following 'if' construct in python code. What does > this idiom accomplish? What happens if this is not main? How did I get > here if it is not main? A quick example demonstrates the usage: C:\code>type temp.py prin

Re: What is proper way to require a method to be overridden?

2007-01-05 Thread Patrick Down
jeremito wrote: > I am writing a class that is intended to be subclassed. What is the > proper way to indicate that a sub class must override a method? > > Thanks, > Jeremy Decorators to the rescue? def must_override(f): def t(*args): raise NotImplementedError("You must override " +

Re: newbie question concerning formatted output

2005-11-29 Thread Patrick Down
>>> a = [str(i) for i in range(0,17)] >>> for i in range(0,len(a),3): ... print " ".join(a[i:i+3]) ... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's garbage collection was Re: Python reliability

2005-10-14 Thread Patrick Down
Paul Rubin wrote: > I haven't been keeping up with this stuff in recent years so I have a > worse concern. I don't know whether it's founded or not. Basically > in the past decade or so, memory has gotten 100x larger and cpu's have > gotten 100x faster, but memory is less than 10x faster once yo

Re: Moinmoin config

2005-08-17 Thread Patrick Down
Mark wrote: > Hi, > > I have Moinmoin 1.3.4 installed and working on Linux RHEL3.0. However, > all screen elements are lined up on the left hand side. How can I get > it displayed like the wiki at: Well, this is probably a better question for the moin lists but I have seen this behavior before.

Re: Python in Games (was RE: [Stackless] Python in Games)

2005-06-14 Thread Patrick Down
My understanding is that the upcoming Civilization IV will have python scripting. -- http://mail.python.org/mailman/listinfo/python-list

Re: If - Or statements

2005-06-07 Thread Patrick Down
What about: if True in [thefile.endswith(x) for x in ('mp3','mp4','ogg','aac','wma')]: -- http://mail.python.org/mailman/listinfo/python-list