문제

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