How can I configure Geany to compile and run my Python programs?

与世无争的帅哥 提交于 2019-11-30 03:48:54

问题


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?


回答1:


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

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




回答2:


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.




回答3:


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

To do so; Edit -> Preference ->Keyboard Shortcuts. Here you can Choose/Change any Key/s to map to any Action you want.

Why? Because some other Linux Program might have overridden, or might have taken the default Geany assigned map Key/s




回答4:


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.

https://www.youtube.com/watch?time_continue=428&v=5xGiSaRqroQ

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

c:\python27\python "%f"




回答5:


For some unknown reason new installed Geany at Ubuntu 19.04 had python "%f" at Build -> Set Build Commands -> Execute default settings. Solved similar issue with python3 "%f" instead.




回答6:


1> find the python console path.

2>now set environment variable



来源:https://stackoverflow.com/questions/2094105/how-can-i-configure-geany-to-compile-and-run-my-python-programs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!