在 Aptana 中配置 Python 以将输出推送到控制台窗口
我最近在学习python。我一直在使用 pyscripter,如 kahnacademy 上演示的那样,但在发现 pyscripter 中的一些错误后,决定升级到更强大的编码环境,因此选择了 aptana studio。
现在我已经正确安装了 python,它将运行脚本,但我似乎无法弄清楚如何让它将打印命令输出到底部的控制台窗口。
为了测试这个,我的脚本很简单:
print "hello"
控制台给我:
Finding files... done.
Importing test modules ... done.
---------------------------------
Ran 0 tests in 0.000s
OK
我知道我在这里缺少一些非常简单的东西,但我不知道它可能是什么。
我只想查看 python 控制台输出 - 我可能会错过什么?
I have very recently been learning python. I have been using pyscripter as is demonstrated over on kahnacademy, but after finding some bugs in pyscripter decided to upgrade to a much more robust coding environ, hence aptana studio.
Right now I have python installed properly, it will run scripts, but I cannot seem to figure out how to get it to output print commands to the console window at the bottom.
To test this my script is simply:
print "hello"
The console gives me:
Finding files... done.
Importing test modules ... done.
---------------------------------
Ran 0 tests in 0.000s
OK
I know I am missing something really simple here but I haven't the foggiest what it could be.
I would like to see the python console output only - what could I be missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Aptana 使用 PyDev。
要在调试模式下运行模块 (.py) 文件,您需要告诉该文件您要执行什么函数。测试时尝试这个模板:
Aptana uses PyDev.
To run modules (.py) files in debug mode you need to tell the file what function you want to execute. Try this template when testing:
您可能正在使用“运行单元测试”启动而不是常规启动。对于常规启动,只需在您正在编辑的文件上按 F9 即可运行。另外,如果您还没有,请阅读 PyDev 入门指南: http://pydev.org/manual_101_root.html (或至少 http://pydev.org/manual_101_run.html,这是与您的问题相关的部分,它还将解释如何配置 Ctrl+F11 重新启动上次启动等)。
You're probably using the 'run unit-tests' launch instead of the regular launch. For a regular launch, just press F9 on the file you're editing and it should work. Also, if you still haven't, read the PyDev getting started guide: http://pydev.org/manual_101_root.html (or at least http://pydev.org/manual_101_run.html, which is the part related to your problem, and it'll also explain how to config Ctrl+F11 to relaunch your last launch, etc).