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 ''
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
> 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
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"?
___
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
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
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
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
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
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
10 matches
Mail list logo