[Tutor] how to accept an integer?
I dun understand the mistake. My aim is to accept an integer number. The python lookup in IDLE asks for a string object but the interpreter returns with the following error message. Some one pls explain. Thank You PS : I understand that i can do type conversion after getting input thru raw_input(). But how does input() function work? >>> prompt="temme a number\n" >>> speed =input(prompt) Traceback (most recent call last): File "", line 1, in speed =input(prompt) TypeError: 'str' object is not callable >>> speed =input("temme a number\n") Traceback (most recent call last): File "", line 1, in speed =input("temme a number\n") TypeError: 'str' object is not callable ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] how to accept an integer?
On Dec 6, 2007 2:31 AM, Mahesh N <[EMAIL PROTECTED]> wrote: > I dun understand the mistake. My aim is to accept an integer number. The > python lookup in IDLE asks for a string object but the interpreter returns > with the following error message. Some one pls explain. > Thank You > > PS : I understand that i can do type conversion after getting input thru > raw_input(). But how does input() function work? > > >>> prompt="temme a number\n" > >>> speed =input(prompt) > > Traceback (most recent call last): > File "", line 1, in > speed =input(prompt) > TypeError: 'str' object is not callable > >>> speed =input("temme a number\n") > > Traceback (most recent call last): > File "", line 1, in > speed =input("temme a number\n") > TypeError: 'str' object is not callable > > > > absolutely, i went up the shell and found out that i had declared a variable named input and it was shadowing the input() function. i restarted the shell and now everything's fine. Thanks Everyone. -- The Place where I Come from, We Face our Enemies, If our enemy is Unarmed, We Offer our SWORD!!! Courtesy "Warrior Within" ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] how to accept an integer?
On Dec 6, 2007 2:37 AM, Eric Brunson <[EMAIL PROTECTED]> wrote: > Mahesh N wrote: > > I dun understand the mistake. My aim is to accept an integer number. > > The python lookup in IDLE asks for a string object but the interpreter > > returns with the following error message. Some one pls explain. > > Thank You > > > > PS : I understand that i can do type conversion after getting input > > thru raw_input(). But how does input() function work? > > Did you read this? > > http://docs.python.org/lib/built-in-funcs.html#l2h-40 > > What do you not understand about it? > > > > > >>> prompt="temme a number\n" > > >>> speed =input(prompt) > > > > Traceback (most recent call last): > > File "", line 1, in > > speed =input(prompt) > > TypeError: 'str' object is not callable > > >>> speed =input("temme a number\n") > > > > Traceback (most recent call last): > > File "", line 1, in > > speed =input("temme a number\n") > > TypeError: 'str' object is not callable > > > > > > > > > > > > ___ > > Tutor maillist - Tutor@python.org > > http://mail.python.org/mailman/listinfo/tutor > > > > sorry i dint go thru the docs. i thought i will delve into it once i felt comfortable with the language. is the new line character not allowed in input() statement ??? cuz i tried it without the new line character and it works fine. More over i find python to be a little sluggish after having worked with C and Java. But one thing's for sure. Its damn powerful and a lovely language. can someone temme where python is most applicable? server side scripting? am i guessing it right? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] PIDA Issue
I have installed pida succesfully using the command python setup.py install Installation was successful i.e. no errors but when i launch pida, it says some module is missing. wat could be the problem??? i am posting the result of installation and of launching the program. maggi:~/Desktop/PIDA-0.5.1#python setup.py install . . . . running install_scripts copying build/scripts-2.4/pida -> /usr/bin copying build/scripts-2.4/pida-remote -> /usr/bin changing mode of /usr/bin/pida to 755 changing mode of /usr/bin/pida-remote to 755 maggi:~/Desktop/PIDA-0.5.1# pida Traceback (most recent call last): File "/usr/bin/pida", line 28, in ? from pida.core.application import main File "/usr/lib/python2.4/site-packages/pida/core/__init__.py", line 3, in ? import pida.core.environment File "/usr/lib/python2.4/site-packages/pida/core/environment.py", line 4, in ?from kiwi.environ import Library, environ ImportError: No module named kiwi.environ I need an IDE badly. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor