Re: [Zope-dev] "Problem" using External Method

2001-01-24 Thread Shane Hathaway
On Wed, 24 Jan 2001, Espen Sorbye Frederiksen wrote: > I did what you suggested, but I am still a bit stuck. Maybe I call them > wrong in my code. I use the call below but get an error. > > > > > Error Type: AttributeError > Error Value: data > > any suggestions what I do wrong, I suggest you r

Re: [Zope-dev] "Problem" using External Method

2001-01-24 Thread Espen Sorbye Frederiksen
> Take out all the "import __main__" statements and you should be fine. > > Python lets you access two namespaces at once: the "local" namespace and > the "global" namespace. Were it not for the global namespace, you would > need to do something like "import __main__". But since globals are > th

Re: [Zope-dev] "Problem" using External Method

2001-01-24 Thread Shane Hathaway
"Espen S. Frederiksen" wrote: > > The problem occur when I try to split up the function as > shown below. I would like to store the data list, update it > if nessesary and return it when appropriate. Am I making it > unessesary complex when I use the class? Is there maybe a > way to declare the d

Re: [Zope-dev] "Problem" using External Method

2001-01-24 Thread Espen S. Frederiksen
ata(): > x = Testclass() > x.setdata(10, 20, 30) > x.updatedata(2) > return x.display() > > - Original Message - > From: "Espen Sorbye Frederiksen" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, January

Re: [Zope-dev] "Problem" using External Method

2001-01-23 Thread Chris McDonough
D]> Sent: Tuesday, January 23, 2001 6:46 PM Subject: Re: [Zope-dev] "Problem" using External Method > Espen, > > The files that external methods actually live in are not Python modules, > like normal Python modules. Though I haven't tried your example, it&#x

Re: [Zope-dev] "Problem" using External Method

2001-01-23 Thread Chris McDonough
OTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 23, 2001 5:52 PM Subject: [Zope-dev] "Problem" using External Method > The module below works using the python compiler > class Testclass: > def setdata(self,val1,val2,val3): > self.data = [val1,va

[Zope-dev] "Problem" using External Method

2001-01-23 Thread Espen Sorbye Frederiksen
The module below works using the python compiler class Testclass: def setdata(self,val1,val2,val3): self.data = [val1,val2,val3] def updatedata(self, index): self.data[index] = self.data[index]+1 def display(self): print self.data x = Testclass() def creat