[Zope] Float object not callable (newbie question)

Brian Hickey brian.hickey at version1.ie
Fri May 13 11:16:51 EDT 2005


Hi Paul,

----- Original Message ----- 
From: "Paul Hendrick" <paul.hendrick at gmail.com>
To: <zope at zope.org>
Sent: Friday, May 13, 2005 4:06 PM
Subject: [Zope] Float object not callable (newbie question)


> hi all,
> I'm trying to write a simple app which takes a name, bank balance,
> interest rate and returns the balance once 1 years interest has been
> added. I'm getting the error that float object is not callable.
> i can't figure out where i'm going wrong :S
>
> my code is below(getDetails, showDetails,doStuff.py), thanks for any
> input!
> paul.
>
> <html>
> <body>
>
> <form action="showDetails" method=post>
>  <input name="name:str"> NAME<br>
>  <input name="balance:float"> BALANCE<br>
>  <input name="interestRate:float"> INTEREST RATE<br>
>  <input type="submit" value="calculate">
> </form>
>
> </body>
> </html>
> ------------------
> <html>
> <body>
>
> <span tal:define="name request/name;
>                   balance request/balance;
>                   rate request/interestRate">
>  <span tal:content="python: here.doStuff(name,balance,rate)"></span>
> </span>
>
> </body>
> </html>
> --------------
> years = 1
> newBal = balance( balance*(rate*years))

You seem to be calling a function here called 'balance' which is the name of
the parameter.
Should it not be just:
newBal = balance*(rate*years)


>
> returnList = [name,newBal]
>
> return returnList
>
>

Hope that helps,
Brian



More information about the Zope mailing list