[Tutor] Instantiate a subClass using an instance of its baseClass

2006-02-12 Thread Kenny Li
Hi Tutor:   My question is "how to instantiate a subClass using an instance of its baseClass?"   Details below: =   class B(object):      ''' the baseClass '''     def __init__(self, arg1, arg2):     self.a1=arg1     self.a2=arg2   class C(B):     ''' C is subClass of B ''

Re: [Tutor] nice()

2006-02-12 Thread Ismael Garrido
Smith wrote: > I've been thinking about a function that was recently proposed at > python-dev named 'areclose'. It is a function that is meant to tell > whether two (or possible more) numbers are close to each other. It > is a function similar to one that exists in Numeric. One such > implement

Re: [Tutor] nice()

2006-02-12 Thread R. Alan Monroe
> On Sun, 12 Feb 2006, Smith wrote: >> ... I think there is less baggage for the new user to think >> about if the name is something like nice()--a function that makes the >> floating point numbers "play nice." And I also think the name...sounds >> nice.) > For "number is close enough"? How abou

Re: [Tutor] nice()

2006-02-12 Thread Terry Carroll
On Sun, 12 Feb 2006, Smith wrote: > ... I think there is less baggage for the new user to think > about if the name is something like nice()--a function that makes the > floating point numbers "play nice." And I also think the name...sounds > nice.) For "number is close enough"? ___

[Tutor] self

2006-02-12 Thread Shuying Wang
Hi, I'm having problems understanding some code I came across: class Singleton: __single = None def __init__( self ): if Singleton.__single: raise Singleton.__single Singleton.__single = self What does passing self to Singleton.__single do? --Shuying

Re: [Tutor] nice()

2006-02-12 Thread Alan Gauld
I have no particularly strong view on the concept (except that I usually see the "problem" as a valuable opportunity to introduce a concept that has far wider reaching consequences than floating point numbers!). However I do dislike the name nice() - there is already a nice() in the os module with

[Tutor] SOLVED: Re: cgi script: how to continue a process in the background and return from cgi script

2006-02-12 Thread Moritz Lennert
On Fri, February 10, 2006 21:03, Hugo González Monteverde wrote: > >> So, could some give me a pointer to possible solutions ? Do I have to >> make the last part of my program a seperate program and go through a >> system call ? > > Hi, > > I have had this problem before. The timeout problem with A

[Tutor] nice()

2006-02-12 Thread Smith
I've been thinking about a function that was recently proposed at python-dev named 'areclose'. It is a function that is meant to tell whether two (or possible more) numbers are close to each other. It is a function similar to one that exists in Numeric. One such implementation is   def arec

Re: [Tutor] Change files

2006-02-12 Thread David Holland
Thanks,  now I understand and that works perfectly.[EMAIL PROTECTED] wrote: David,  in getfiles, the os.getcwd() points the main programs cwd only and so shutil.copy() fails. so changing to name = os.path.join(root,name) helps us get the file in the directory we checked against.   def getfi

Re: [Tutor] Change files

2006-02-12 Thread Senthil_OR
David,  in getfiles, the os.getcwd() points the main programs cwd only and so shutil.copy() fails. so changing to name = os.path.join(root,name) helps us get the file in the directory we checked against.   def getfiles(file1,file2,top):    for root, dirs, files in os.walk(top):    for d