我正在尝试在 Ubuntu 上运行的 Eclipse/PyDev 中调试 Google AppEngine 项目。
调试通常工作正常,但我无法在调试控制台中计算表达式。我相信控制台正在启动 AppEngine 服务器,并暂停等待 AppEngine 开发服务器结束,因此我无法获得评估提示。
这是调试控制台中的输出:
pydev debugger: warning: psyco not available for speedups (the debugger will still work correctly, but a bit slower)
pydev debugger: starting
/home/eric/src/google_appengine/google/appengine/tools/appcfg.py:42: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha
/home/eric/src/google_appengine/google/appengine/tools/dev_appserver_login.py:33: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5
INFO 2010-11-02 22:00:13,657 appengine_rpc.py:153] Server: appengine.google.com
INFO 2010-11-02 22:00:13,679 appcfg.py:414] Checking for updates to the SDK.
INFO 2010-11-02 22:00:14,010 appcfg.py:428] The SDK is up to date.
WARNING 2010-11-02 22:00:14,011 datastore_file_stub.py:818] Could not read datastore data from /tmp/dev_appserver.datastore
INFO 2010-11-02 22:00:14,080 dev_appserver_main.py:443] Running application manualent on port 8080: http://localhost:8080
请注意,它永远不会在控制台末尾打印提示以输入要计算的表达式。
知道如何正确显示提示,以便我可以在调试期间评估表达式吗?
最佳答案
您是否考虑过使用应用程序中的 AppEngine 交互式控制台?
http://code.google.com/appengine/docs/python/tools/devserver.html#The_Development_Console
服务器当前正在使用Python解释器,这就是为什么你永远不会收到提示(因为它只是一个解释器,并且已经在使用中);如果您想在服务器上下文中运行 Python 表达式,则需要使用开发控制台。
第三方开发人员还提供了一个更“类似于控制台”的交互式 Python session 版本:http://con.appspot.com/console/help/about
关于python - 使用 AppEngine 开发服务器在 PyDev 中调试控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4082520/