如何配置 Geany 来编译和运行我的 Python 程序?

发布于 2024-08-18 13:07:21 字数 151 浏览 7 评论 0原文

在“构建”菜单下,我可以看到“执行”选项,但它是灰色的。

唯一可用的选项是“设置包含和参数”。当我单击时,两个字段都已填写。我必须在那里写什么?

替代文字

Under the Build menu, I can see 'Execute' option, but it is greyed out.

The only option available is 'Set Includes and Arguments'. When I click that both fields are already filled out. What do I have to write there?

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

清风不识月 2024-08-25 13:07:21

我不需要在 Geany 中配置任何内容。我只需点击 F5 即可执行当前模块。

您确定您的文件被识别为 Python 源文件吗?您使用的是哪个版本的 Geany(我使用的是 SVN 版本,非常稳定;该死,它非常稳定;-))?我的版本中有一个稍微更完善的 Python 编译配置,但命令是相同的,并且运行得很好。

I don't need to configure anything in Geany. I just hit F5 and the current module is executed.

Are you sure that your file is recognized as a Python source file? Which version of Geany are you using (I am using the SVN version, which is pretty stable; damn, it's rock solid stable ;-))? I have a slightly more developed configuration for Python compilation in my version, but the commands are the same and it works very well.

绻影浮沉 2024-08-25 13:07:21

我遇到了同样的问题,并找到了以下解决方案:

在“构建选项”对话框中,单击对话框底部的“_执行”,_执行选项变为可编辑。

我将 Python 安装的完整路径名放在那里 (C:\Python27\python %F) 或 (C:\Python32\python %F),它似乎工作得很好。

I had the same problem and found the following solution:

In the 'Build Options' dialogue, click on '_Execute' at the bottom of the dialogue and the _execute options become editable.

I put the full path name to my Python install in there (C:\Python27\python %F) or (C:\Python32\python %F) and it seems to work just fine.

铁轨上的流浪者 2024-08-25 13:07:21

由于某种未知原因,新安装的 Geany 在 Ubuntu 19.04 ( Disco Dingo)在构建设置构建命令执行默认设置中有python“%f”

我用 python3 "%f" 解决了类似的问题。

For some unknown reason a new installed Geany at Ubuntu 19.04 (Disco Dingo) had python "%f" at BuildSet Build CommandsExecute default settings.

I solved a similar issue with python3 "%f" instead.

叹倦 2024-08-25 13:07:21

另外,不要忘记设置“KeyBinding”,即您按下以激活“运行、执行、编译、保存”的键盘快捷键(单个或组合) 、查找、打印等...

这样做;

菜单编辑首选项键盘快捷键

在这里您可以选择/更改任何键以映射到您想要的任何操作。

为什么?因为其他一些 Linux 程序可能已被覆盖,或者可能已采用默认的 Geany 分配的映射键。

Also don’t forget to set the “KeyBinding”, i.e., the keyboard shortcut-key (single or combination) you press to activate “Run, Execute, Compile, Save, Find, Print, etc...

To do so;

Menu EditPreferencesKeyboard Shortcuts.

Here you can choose/change any Key/s to map to any action you want.

Why? Because some other Linux program might have been overridden, or might have taken the default Geany assigned map keys.

再可℃爱ぅ一点好了 2024-08-25 13:07:21

您需要在一开始就设置路径变量。或者您需要在构建→设置构建命令中设置变量。

此视频可以让您清楚地了解:

Install Geany for Python

您的编译路径看起来不错。但在执行路径中,给出 python.exe 的完整路径。就我而言,它是...

C:\python27\python "%f"

You need to set the path variables in the beginning. Or you need to set the variables in Build → set build commands.

This video can give you good clarity:

Install Geany for Python

Your compile path is looking fine. But in the execution path, give the full path of your python.exe. In my case it is...

C:\python27\python "%f"

守护在此方 2024-08-25 13:07:21
  1. 查找 Python 控制台路径。

  2. 现在设置环境变量

  1. Find the Python console path.

  2. Now set the environment variable

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文