简体   繁体   English

如何使用运行模块功能在Komodo IDE中像在IDLE(Python GUI)中一样运行python程序?

[英]How can I run a python program in Komodo IDE like in IDLE(Python GUI) using Run Module feature?

Sorry I am a Python beginner and after several months with Python(GUI) I now want to move to Komodo IDE 8.5 (Suggested by posts on this forum), but I had trouble on configuring it to proper use. 抱歉,我是Python初学者,在使用Python(GUI)几个月后,我现在想转到Komodo IDE 8.5(此论坛上的帖子建议),但是在将其配置为正确使用时遇到了麻烦。 The main issue is how I can run a Python program in Komodo like in IDLE(Python GUI) using Run Module (pressing F5) feature? 主要问题是如何使用运行模块(按F5)功能像在IDLE(Python GUI)中那样在Komodo中运行Python程序?

When I pressed F5 in Komodo IDE 8.5, I got message "No Python interpreter is available". 当我在Komodo IDE 8.5中按F5时,收到消息“没有Python解释器可用”。

I am using Python 3.30. 我正在使用Python 3.30。 Python.exe is in this path "D:\\1_tools\\python". Python.exe在此路径“ D:\\ 1_tools \\ python”中。 Komodo.exe is in this path "D:\\1_tools\\komodo_IDE" Komodo.exe在此路径“ D:\\ 1_tools \\ komodo_IDE”中

Thanks for any kind helpers. 感谢您的帮助。 I have searched the forum but did not get any helpful info. 我已经搜索了论坛,但没有得到任何有用的信息。 Thanks again. 再次感谢。

There is a thread on the Komodo Community Site that discusses this exact situation. Komodo社区站点上有一个线程讨论此确切情况。 ( http://community.activestate.com/node/10113 ) http://community.activestate.com/node/10113


Sumarizing: Sumarizing:

It seems that Komodo IDE defaults to using Python2 and since it can't find a Python2 interpreter, it complains. 看来Komodo IDE默认使用Python2,并且由于找不到Python2解释器,因此会抱怨。

Solution : 解决方案

  • For existing files, the suggested solution is to tell Komodo IDE (via "Properties and Settings" on the Editor Tab) that the file uses the Python 3 interpreter. 对于现有文件,建议的解决方案是(通过“编辑器”选项卡上的“属性和设置”)告诉Komodo IDE该文件使用Python 3解释器。

  • If you create all new python source files using the Python3 template, the IDE will be able to run them. 如果使用Python3模板创建所有新的python源文件,则IDE将能够运行它们。
    Beware: The first time you want to use the Python3 template you will have to create the new file using the menu: "File" -> "New" -> "File from Template", then select the Python 3 template. 注意:第一次使用Python3模板时,必须使用菜单“文件”->“新建”->“文件中的文件”创建新文件,然后选择Python 3模板。

Is Python on your PATH? Python是否在您的PATH上? That is, if you open a command prompt and type python by itself, does it run? 也就是说,如果您打开命令提示符并单独键入python,它会运行吗? In Komodo, look under Edit/Preferences/Languages/Python3 and check the configuration. 在Komodo中,在“编辑/首选项/语言/ Python3”下查看并检查配置。 If python.exe is not on your PATH you can provide the full path to it there 如果python.exe不在您的PATH上,则可以在其中提供完整路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM