RE: [Zope] wrong value for integer variable?
-----Original Message----- From: Donald Holten [mailto:donner@biophysics.lanl.gov] Sent: Wednesday, July 28, 1999 4:14 PM To: michel@digicool.com Cc: zope@zope.org Subject: RE: [Zope] wrong value for integer variable?
Something very interesting... I changed the code as you said, and, as I sort of figured, it didn't work (only because I saw that python has no way to convert strings to ints).
Sure it does, int(). In DTML, you can access this via the _ namespace, ie. <dtml-if "_.int('1') == 1"> Hey, it works! </dtml-if> -Michel
I wouldn't be too surprised if the reason I'm getting such strange errors has something to do with how it was installed. The version we are using is the 2.something alpha version released on the 13th of July. I've had problems of all kinds while programming in Zope. It just seems to add to my feeling that something went wrong during installation. Donner
I wouldn't be too surprised if the reason I'm getting such strange errors has some thing to do with how it was installed. The version we are using is the 2.something alpha version released on the 13th of July. I've had problems of all kinds while programming in Zope. It just seems to add to my feeling that something went wrong during installation. Donner
At 4:27 pm -0400 28/7/99, Michel Pelletier wrote:
-----Original Message----- From: Donald Holten [mailto:donner@biophysics.lanl.gov] Sent: Wednesday, July 28, 1999 4:14 PM To: michel@digicool.com Cc: zope@zope.org Subject: RE: [Zope] wrong value for integer variable?
Something very interesting... I changed the code as you said, and, as I sort of figured, it didn't work (only because I saw that python has no way to convert strings to ints).
Sure it does, int(). In DTML, you can access this via the _ namespace, ie.
<dtml-if "_.int('1') == 1"> Hey, it works! </dtml-if>
-Michel
There's also atoi, which uses an arbitrary base...I tried to use it so; and got an attribute error <dtml-var "_.atoi('178')"> and <dtml-var "_.atoi('178', 16)"> tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
Tony McDonald schrieb:
At 4:27 pm -0400 28/7/99, Michel Pelletier wrote:
-----Original Message----- From: Donald Holten [mailto:donner@biophysics.lanl.gov] Sent: Wednesday, July 28, 1999 4:14 PM To: michel@digicool.com Cc: zope@zope.org Subject: RE: [Zope] wrong value for integer variable?
Something very interesting... I changed the code as you said, and, as I sort of figured, it didn't work (only because I saw that python has no way to convert strings to ints).
Sure it does, int(). In DTML, you can access this via the _ namespace, ie.
<dtml-if "_.int('1') == 1"> Hey, it works! </dtml-if>
-Michel
There's also atoi, which uses an arbitrary base...I tried to use it so; and got an attribute error <dtml-var "_.atoi('178')"> and <dtml-var "_.atoi('178', 16)"> tone
I think atoi comes from the string module. Maybe <dtml-var "_.string.atoi('178')"> works.
------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
-- fon: ++49 (0)40 42878 3781 fax: ++49 (0)40 42878 2728
There's also atoi, which uses an arbitrary base...I tried to use it so; and got an attribute error <dtml-var "_.atoi('178')"> and <dtml-var "_.atoi('178', 16)"> tone
I think atoi comes from the string module. Maybe <dtml-var "_.string.atoi('178')"> works.
Quite right - my fault, <dtml-var "_.string.atoi('178')"> and <dtml-var "_.string.atoi('178', 16)"> both work thanks, tone. ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
participants (4)
-
Donald Holten -
Michel Pelletier -
Thomas Weiner -
Tony McDonald