Unable to provide user input in PyDev console on Eclipse with Jython

巧了我就是萌 提交于 2019-12-06 15:04:22

问题


I was trying to debug a jython program for a long time that I was running in Eclipse using the PyDev plugin, but it worked once I ran it from the terminal instead. I suspected it might be that the user input wasn't working on the Eclipse console, so I tried running the most basic input program for jython I could think of

name = raw_input("What is your name? ")
print "Hello %s" % (name)

When this runs it outputs

What is your name? 

and when I type in the console, the normal green text appears, but upon hitting enter, nothing happens. How can I get the console to feed the input back to the process?

EDIT: The input is fed to the program upon pressing Terminate, so it outputs

Hello name

Also, this is only happening when using PyDev, input works fine when running java code in the java perspective


回答1:


This is really strange (and works for me).

So, to properly identify what's happening, I need some more info:

  1. What's the jython version you're using?

  2. Do you have something in your error log?

  3. What's the Eclipse version?

  4. How exactly are you doing the run? (hint: just pressing F9 should be enough)



来源:https://stackoverflow.com/questions/16072466/unable-to-provide-user-input-in-pydev-console-on-eclipse-with-jython

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!