Re: Class problem

From: Daniel Pryde (dpryde+usenet_at_cis.strath.ac.uk)
Date: 12/08/03


Date: Mon, 08 Dec 2003 18:02:27 +0000

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



Relevant Pages

  • RE: Class problem
    ... > Rene Pijlman wrote: ... >> import spam ... please post the source code and exact text of the ... > class ImagePyramid: ...
    (comp.lang.python)
  • Re: Re:Trojan Horse Detection tools(Possibly off-topic)
    ... Trojan Horse Detection tools ... >> source code, but code inspection is very cumbersome and sufficient ... Is SPAM over-loading your e-mail server, ... Download your free fully functional trial, complete with 30-days of free technical support. ...
    (Security-Basics)
  • Re: Creating a local variable scope.
    ... the definition of ham. ... spam = 'abc' # Used only in definition of ham. ... eggs = 'def' # Likewise. ...
    (comp.lang.python)
  • Re: Test driven development
    ... I don't regularly use TDD yet, and one of the reasons is that in many ... a function spam(), so I write tests for it. ... the function and see that I need to write functions ham() and eggs. ... you extract eggs(). ...
    (comp.lang.python)
  • Re: Spam Turns Serious and Hormel Turns Out More
    ... fast food joints (how are greasy salty fries better than spam, ... Spam with eggs is more ... healthful than bacon/sausage and eggs. ...
    (rec.food.cooking)