Being sure that my number is Int
Im making a very simple python script within zope. It has only one parameter and all it does is add 1 to the param value: a = param b = a + 1 return (a) The problem is (I guess) that 'param' isnt a Int value, how can I "say" to zope that it is? Thanks for the help!!
Hi Alexandre, Please send only plain-text messages to the mailing list... There is a built-in numeric function that you can use: int()... a = int(param) b = a + 1 return (a) HTH, Eric. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Alexandre Aguiar Sent: Monday, August 06, 2001 11:32 AM To: zope@zope.org Subject: [Zope] Being sure that my number is Int Im making a very simple python script within zope. It has only one parameter and all it does is add 1 to the param value: a = param b = a + 1 return (a) The problem is (I guess) that 'param' isnt a Int value, how can I "say" to zope that it is? Thanks for the help!!
a = int(param) also if that is the actual code you will want to either make line 2: a = a + 1 or the last line: return b Code inside python scripts is "python" so you can find the answers to these types of questions by either purchasing a python book or reading the python references at www.python.org. Take care, -- Jeffrey D. Peterson Webmaster/Web & Web Applications Engineer Range TV Cable & Broadband 1818 E. 3rd Ave. Hibbing, MN 55746 jpeterso@rangebroadband.com -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Alexandre Aguiar Sent: Monday, August 06, 2001 1:32 PM To: zope@zope.org Subject: [Zope] Being sure that my number is Int Im making a very simple python script within zope. It has only one parameter and all it does is add 1 to the param value: a = param b = a + 1 return (a) The problem is (I guess) that 'param' isnt a Int value, how can I "say" to zope that it is? Thanks for the help!!
participants (3)
-
Alexandre Aguiar -
Eric Walstad -
Jeff Peterson