tengo el siguiente código Python:¿Por qué input() da un error cuando solo presiono enter?
print 'This is a simple game.'
input('Press enter to continue . . .')
print 'Choose an option:'
...
Pero cuando se presiona el botón Introduzca, me sale el siguiente error:
Traceback (most recent call last):
File "E:/4.Python/temp.py", line 2, in <module>
input('Press enter to continue . . .')
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
P. S. Estoy utilizando Python IDLE versión 2.6 en Windows 7.
+1 para el ejemplo :-) – user225312
En realidad, no se puede * asignar * nada en 'eval'. Sin embargo, puedes llamar al método destructivo que quieras, por lo que no es mucho mejor. – delnan
O bien, desea utilizar Python 3, donde 'input()' hace lo que Python 2 'raw_input()' hizo. –