Class problem

Robert Brewer fumanchu at amor.org
Mon Dec 8 19:27:54 CET 2003


Let's hope your home version had double underscores surrounding "init".
;)

class ImagePyramid:
    def __init__(self, parameters):
        do stuff :-)


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.og

> -----Original Message-----
> From: Daniel Pryde [mailto:dpryde+usenet at cis.strath.ac.uk] 
> Sent: Monday, December 08, 2003 10:02 AM
> To: python-list at python.org
> Subject: Re: Class problem
> 
> 
> Rene Pijlman wrote:
> 
> > Daniel Pryde:
> > 
> >>when I import it and try to make an instance of it, it returns with 
> >>the error that 'module' is not callable.
> > 
> > 
> > My guess is you should do:
> > 
> >   import spam
> >   eggs = spam.spam()
> > 
> > instead of:
> > 
> >   import spam
> >   eggs = spam()
> > 
> > If not, please post the source code and exact text of the 
> error message.
> > 
> 
> Thanks. Sorry everyone for not posting the problem code with 
> it. I only 
> have internet access at university and unfortunately the code's on my 
> home hard drive, however it was something like:
> ===========
> import Image
> 
> class ImagePyramid:
> 	def _init_(self, parameters):
> 		do stuff :-)
> ===========
> 
> And I would use it as such:
> ===========
> import ImagePyramid
> pyramid = ImagePyramid(parameters)
> ===========
> 
> I'l try out the above solution and hopefully that'll fix 
> things. Thanks.:-)
> 
> Daniel
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 





More information about the Python-list mailing list