[Geany-Users] running cmd from build

Matthew Brush mbrush at xxxxx
Tue May 22 19:25:17 UTC 2018


On 2018-05-22 08:22 AM, Joe McCarron via Users wrote:
> Hello folks,I am using Linux mint with Geany 1.27
> 
> I get this error when running a command from Build->Set Build Commands/tmp/geany_run_script_KH9HJZ.sh: 7: /tmp/geany_run_script_KH9HJZ.sh: /home/joe/pythonbuild.py: Permission denied
> when i run from the command line it works. Here is what I put on the command line.python pythonbuild.py dev/Arduino/sample/sample.ino
> 
> The set Build Command in Geany is:   /home/joe/pythonbuild.py
> I get the erro above when this is exectuted from Geany
> It looks like Geany runs a script from the tmp directory to run my py script.
> I just switched from windows to linux so that could be part of my problem.
> thanksJoe
> 

Hi,

You probably have to mark the script executable and put a "shebang" in 
it. Unlike Windows, Linux doesn't go by file extension, a script has to 
be made executable (ex `chmod +x yourscript.py` or from your file 
manager) and the first line tells which interpreter to use (ex. 
`#!/usr/bin/env python`).

Alternatively, you could just change your build command in Geany to run 
the script using Python like what you ran on the command line, so it 
doesn't need to be executable or have a shebang line. Just put `python 
/home/joe/pythonbuild.py` in the build command.

Regards,
Matthew Brush



More information about the Users mailing list