TheHegemon wrote:Okay, so maybe I'm just making a newbie error, but I'm working with python 3.2 and a linux box at the moment. When these programs are run via the terminal and ask for user input, they invariably throw a name error. If, for example, I input 'asdf' (without the quotes), the terminal tells me: NameError: name 'asdf' is not defined.
Python 3.2.1 (default, Jul 11 2011, 18:55:33)
[GCC 4.6.1 20110627 (Red Hat 4.6.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'asdf' is not defined
>>> asdf = 'some value'
y = str(input('y? '))
y = raw_input("y? ")
y = str(input("y? "))
y = input("y? ")
Users browsing this forum: Bing [Bot] and 7 guests