[Geany-Users] running cmd from build

Lex Trotman elextr at xxxxx
Wed May 23 01:34:27 UTC 2018


What directory is 'pythonbuild.py' located in and what was the working
directory when you ran the CLI command?

If your command is 'python pythonbuild.py
dev/Arduino/sample/sample.ino' then it must be executed in the
directory that contains 'pythonbuild.py' since the path is given
relative to the working directory (and so is
'dev/Arduino/sample/sample.ino' but we havn't gotten to it yet :).

Geany commands (by default) run with a working directory that is the
directory of the current file displayed in the edit area, you can
change this in the "working directory" column of the "set build
commands" dialog to make it a fixed location such as the directory
where 'pythonbuild.py' lives.

Cheers
Lex

On 23 May 2018 at 10:57, Joe McCarron via Users <users at lists.geany.org> wrote:
> I tried that but I got "Invalid working directory" error.
> Without the %d/%f at least ran the python script but then errored
> since there wasn't a file to work on.
>
> Thanks
>
>
> On Tuesday, May 22, 2018, 6:47:50 PM EDT, Lex Trotman <elextr at gmail.com>
> wrote:
>
>
> Or just simply make the Geany build command THE SAME as the command line.
>
> On 23 May 2018 at 06:57, Joe McCarron via Users <users at lists.geany.org>
> wrote:
>> Thanks for your response Matthew. I think I will just run from the CLI.
>> I am still getting errors when running cmds via Geany.
>>
>> I did change it to an executable but that didn't work. Linux did not
>> recognize it as a command
>> when launched using only the file name, even with the 'shebang' in the
>> script.
>>
>> I tried your other idea about putting what works into the CLI into Geany
>> but
>> I still got "permission denied"
>> error. Although I am not getting anything done, I am learning alot. : )
>>
>> Well now on to see if I can get syntax highlighting working along with
>> auto
>> complete. Wish me
>> luck. Thanks again.
>>
>> Joe McCarron
>>
>>
>>
>>
>> On Tuesday, May 22, 2018, 3:25:36 PM EDT, Matthew Brush
>> <mbrush at codebrainz.ca> wrote:
>>
>>
>> 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
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.geany.org
>> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.geany.org
>> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>
>>
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>


More information about the Users mailing list