eclipse:运行/调试当前文件
在寻找 Python 调试器时,我偶然发现了 Aptana,它基于 eclipse。
通常,我想调试单个 python 脚本。但是,Aptana 不会让我直接运行/调试当前打开的文件。
相反,它要求我为我想要运行/调试的每个文件创建一个调试/运行配置。或者,我可以在 Aptana 中创建一个 Python 项目。
但是:我不想。我只想能够运行或调试当前打开的文件。这样我想调试我的脚本,而不必被迫先创建一个项目(对于每个脚本!)。
有那么难吗?
In search of a Python debugger I stumbled upon Aptana, which is based on eclipse.
Often, I want to debug a single python script. However, Aptana won't let me run/debug the currently opened file directly.
Instead, it requires me to create a debug/run configuration for each file I would like to run/debug. Alternatively I could create a Python project in Aptana.
But: I don't want to. I just want to be able to run or debug the currently opened file. This way I would like to debug my scripts without being forced to create a project first (for each single script!).
Can it be that hard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是因为 Aptana/Eclipse 没有“意识到”您打开的文件应该使用 Python 调试器进行调试,因为它与 Python 项目/透视图无关(在 Aptana/Eclipse 中创建项目时有很多环境设置) )。
在我看来,最简单的解决方案是创建一个简单的沙箱 Python 项目,然后将文件放入其中来运行/调试。然后,Aptana 应该意识到您正在处理 Python,并开始运行 Python 调试器而无需设置(无论如何,这是我在 Eclipse 中使用 PyDev 的经验)。
This is because Aptana/Eclipse doesn't "realize" that the file you opened should be debugged using the Python debugger as it's not associated with a Python project/perspective (there's a lot of environment setup when a project is created in Aptana/Eclipse).
The simplest solution, IMO, would be to create a simple sandbox Python project and just stick your files in there to run/debug. Aptana should then realize you're dealing with Python and start running the Python debugger without setup (that's my experience w/ PyDev in Eclipse, at any rate).
请参阅:使用 Eclipse PyDev 运行外部 Python 程序 (注意:您确实需要一个项目,但您的文件不需要在其中)。
See: Run External Python Programs with Eclipse PyDev (note: you really need a project, but your file doesn't need to be in it).