problem with subracting from number that I get with cgi module
Darrell
darrell at dorb.com
Thu Dec 30 22:32:21 EST 1999
Try this.
num = string.atoi( urlargs["num"].value)
--Darrell
----- Original Message -----
From: "Jeremy Lunn" <aussiepenguin at yahoo.com>
To: <python-list at python.org>
Sent: Thursday, December 30, 1999 10:05 PM
Subject: problem with subracting from number that I get with cgi module
> Hi,
>
> I am trying to get a number with the cgi modules like:
> form = cgi.FieldStorage()
> num = urlargs["num"].value
>
> But I can't subtract from it, when I try to do that like:
> newnum = num-1
>
> I get an error like this:
> Traceback (innermost last):
> File "./numtest.py", line 9, in ?
> numtwo = num-1
> TypeError: bad operand type(s) for -
>
> Would this mean that the number I am getting isn't really a number or
> what?
>
> Anyone have any ideas how I could get this to work?
>
> Thanks
>
> Jeremy
>
>
> --
> Jeremy Lunn
> Melbourne, Australia
> ICQ: 19255837
>
> --
> http://www.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list