سؤال

I'm using qpython and when I'm using raw_input function I'm getting an EOF error, for example -

print " what's ur name",
a = raw_input()
print " hello %r"%a

and I'm getting this result -

what's ur name ?
Traceback (most recent call last):
File "main.py", line 2, in 
  a= raw_input()
EOFError: EOF when reading a line

What's the problem ????

هل كانت مفيدة؟

المحلول

According to Why is raw_input() missing? Any other alternatives? from QPython forum:

The raw_input function does not work because there is no console mode like the pc in QPython+. But there is another methord to get users input, you can do Kivy programming, it offer the UI support, and you can get user input by using it's dialog or other input method.

نصائح أخرى

Please add "#qpy:console" to let your script run with console, which you can use raw_input correctly.

more about the user mode

http://wiki.qpython.org/doc/program_guide/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top