Re: [Tutor] help for building tui?

2008-07-03 Thread Wolfram Kraus
Am 04.07.2008 08:33, Dong Li schrieb: Hi, everyone If I want to create a text user interface for my application, is there any existed module to facilitate such building? Yes, there is curses: http://docs.python.org/lib/module-curses.html http://www.amk.ca/python/howto/curses/ HTH, Wolfram

[Tutor] help for building tui?

2008-07-03 Thread Dong Li
Hi, everyone If I want to create a text user interface for my application, is there any existed module to facilitate such building? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Fibonacci series(perhaps slightly off topic)

2008-07-03 Thread Mark Tolonen
You can actually remove the try/except, because if the calculation key-len(self.fibsseq)+1 <= 0 the for loop won't execute. The for loop will make sure self.fibsseq is long enough to satisify the return self.febsseq[key] access: class Fibs(object): def __init__(self): self.fibsseq =

Re: [Tutor] Array filling

2008-07-03 Thread Eike Welk
On Thursday 03 July 2008 15:53, Brain Stormer wrote: > I am using numpy to create an array then filling some of the values > using a for loop, I was wondering if there is way to easily fill > the values without iterating through sort of like > "array.fill[start:stop,start:stop]"? The reason for my

[Tutor] Mixer and Busy Flag Never Working?

2008-07-03 Thread FT
A Question: Has anyone ever played with Pygame and the sound mixer? If so, has anyone ever had the busy flag, and the problem below ever work? Subject: Re: [pygame] Mixer Quit / Restart This appears to get the total number of channels, not the number of active channels. However, I tried u

Re: [Tutor] Array filling

2008-07-03 Thread bob gailer
Brain Stormer wrote: I am using numpy to create an array then filling some of the values using a for loop, I was wondering if there is way to easily fill the values without iterating through sort of like "array.fill[start:stop,start:stop]"? The reason for my question is, in some cases, I migh

Re: [Tutor] Question about string

2008-07-03 Thread Michael yaV
org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Python is one of the smartest languages, it does many things for the programmer (I don't know but this might be what they mean with Batteries-Included) , & you have just scratched the surface

Re: [Tutor] Question about string

2008-07-03 Thread Dong Li
1" > > Python is one of the smartest languages, it does many things for the > programmer (I don't know but this might be what they mean with > Batteries-Included) , & you have just scratched the surface of it, here > python concatenated your strings together for you, later

Re: [Tutor] directory traversal help

2008-07-03 Thread Kent Johnson
On Thu, Jul 3, 2008 at 8:47 AM, Michael <[EMAIL PROTECTED]> wrote: > Hi > > I have modified an algorithm from the think like a python programmer book > for traversing folders and printing the files in those folders. It works for > my original purposes but I have a students that wants to use it to r

Re: [Tutor] Fibonacci series(perhaps slightly off topic)

2008-07-03 Thread Emil
Hey John thank you for your reply. I came up with this code, it is not elegant( yet) but i would say that it is more efficient :) class Fibs(object): def __init__(self): self.fibsseq = [0,1] def __getitem__(self, key): try:

[Tutor] Array filling

2008-07-03 Thread Brain Stormer
I am using numpy to create an array then filling some of the values using a for loop, I was wondering if there is way to easily fill the values without iterating through sort of like "array.fill[start:stop,start:stop]"? The reason for my question is, in some cases, I might have to fill hundreds (w

[Tutor] directory traversal help

2008-07-03 Thread Michael
Hi I have modified an algorithm from the think like a python programmer book for traversing folders and printing the files in those folders. It works for my original purposes but I have a students that wants to use it to run from a root folder, problem is that it crashes on the recycling bin

Re: [Tutor] Question about string

2008-07-03 Thread Monika Jisswel
Python is one of the smartest languages, it does many things for the programmer (I don't know but this might be what they mean with Batteries-Included) , & you have just scratched the surface of it, here python concatenated your strings together for you, later you will meet list comprehention & o

Re: [Tutor] Question about string

2008-07-03 Thread Alan Gauld
"Dong Li" <[EMAIL PROTECTED]> wrote I am new to python, so what I ask may be so basic. I don't know the difference between s = 'a' 'b' and s = 'a'+'b' They have the same results. Thanks for relying! I think the differencec is that the first is purely a syntax thing so the interpreter does t

Re: [Tutor] Inheritance help

2008-07-03 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote Hmm. I don't understand the LSP to make any requirements on the constructors. It says that instances of a subclass should be substitutable for instances of the base class, it doesn't say anthing how the instances are created. LSP doesn't distinguish