I just switched from Windows 10 to Linux mint and trying to use Geany for arduino development
.
I followed Robins instructions from past threads on the subject.
I can verify and download using the command line interface using :
joe@joe-450-a114 ~ $ python pythonbuild.py dev/Arduino/sample/sample.ino
When trying to run from Geany I get the error
Invalid working directory ""/home/joe/dev/Arduino/sample/sample.ino""
That is a valid path and I have permission to both the folder and file.
When i remove the "%d/%f" from the cmd the terminal opens with the error:
/tmp/geany_run_script_1KVMJZ.sh: 7: /tmp/geany_run_script_1KVMJZ.sh: /home/joe/pythonbuild.py: Permission denied.
it looks like from Geany I can not get python to execute for some reason.
Any help is appreciated. I know this is kind of non-main stream topic.
What happens if you enter the command from Geany at a terminal
~/bin/pythonbuild.py
it should run my Python program although it will fail because it does not have a .ino file to work on. If it does not run my Python program then your command is wrong.
Another thought is to enter the command which python
On my PC it gives /usr/bin/python which leads me to think you should not have the tilde at the start of your command.
The ~/bin is where the pythonbuild.py file is, which is home/joe/bin folder
When i run the command without tilde I get pythonbuild.py: not found
When I run the command with the tilde I get ; permission denied
"which python" returns /usr/bin/python which is a shortcut to python 2.7
I used "python ~/bin/pythonbuild.py" as the command and the script ran.
I got an out of range error since %d/%f was not used as the working directory, so that makes sense.
When I did give it the %d/%f I got this error:
Invalid working directory "/home/joe/dev/Arduino/4X20OLED/4X20OLED.ino"
But that is the correct path so I don't know what it isn't liking.
The "shebang" in the script with the correct path to python so it I should not have to add python to the command.
If that is working then my Python program should run (albeit do nothing) when you enter
~/bin/pythonbuild.py
in a terminal.
You said you get "permission denied" so that seems to be the main problem because you said it does work when you enter python pythonbuild.py dev/Arduino/sample/sample.ino
and I presume it will run my program when you enter
python pythonbuild.py
You have not said if you tried using Geany with the command
python ~/bin/pythonbuild.py "%d/%f"
Do you have syntax highlighting and autocomplete working ?
Yes, but the syntax highlighting is not identical to the Arduino IDE. To be honest the colours are meaningless.
and I presume it will run my program when you enter
python pythonbuild.py
Yes, it does at both the command line and Geany, but will run errors out in Geany if I enter
the %d/%f
You have not said if you tried using Geany with the command
python ~/bin/pythonbuild.py "%d/%f"
I get the invalid working directory error
Yes, but the syntax highlighting is not identical to the Arduino IDE. To be honest the colours are meaningless.
I am told ver 3.2 and later has arduino filetypes. I was using ver 2.7
...R
[/quote]
Thanks for your help Robin. I need to walk away from this for a couple of days. When I figure it out
I will post what if anything was going on. If I can figure it out. May just take a fresh re-install.
The way you have responded to my comments (by typing inside the quote) means I cannot quote your responses easily.
"bad interpreter" when run as above. I had to put python in front, like the shebang isn't recognized
Are you sure you have set pythonbuild.py as executable?
What shebang have you actually got in your file?
Yes, it does at both the command line and Geany, but will run errors out in Geany if I enter
the %d/%f
I get the invalid working directory error
Copy and post the exact error messages
I am told ver 3.2 and later has arduino filetypes. I was using ver 2.7
Those sound like Python version numbers. Code highlighting is something in Geany. It is not part of the Python language. Especially as the code you want to highlight is C++, not Python.