You are not logged in.

#1 2016-02-19 21:01:25

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 581
Website

[SOLVED] Geany + Python = no code run??

I am some weeks into life after re-building my computer and upgrading to BunsenLab. Tweaking is mostly over but there are some issues left. Like this one.

Writing Python code is something I mostly do in Geany and I am used to hit F5 to run my code. Not so in BL it seems. I have tried editing set-ups (use terminator and /bin/bash please) but there is no shift in behaviour. All I get is an error message telling me that no shell could be found. The error message appears in a freshly opened instance of terminator.

Anyone know what may be the matter?

Could it be that I have made the BL installation use my native Swedish as the 'system' language (it even confuses me)?

TIA

/Martin

Last edited by Martin (2016-02-20 17:16:55)


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#2 2016-02-20 04:55:42

ohnonot
...again
Registered: 2015-09-29
Posts: 5,568

Re: [SOLVED] Geany + Python = no code run??

shell means python shell i suppose.
have you checked what geany is actually looking for there? maybe you're missing some optional dependencies.


Give to COVAX! Here or here. (explanation)
My Repos: notabug | framagit

Offline

#3 2016-02-20 05:28:35

damo
....moderator....
Registered: 2015-08-20
Posts: 6,719

Re: [SOLVED] Geany + Python = no code run??

Geany has the Run/Execute keybind as F5, as expected. In the "Set Build Commands" dialog, "Execute" is set as "./%f", which implies to me that the python file needs to be executable.

You could also try editing the Execute command, maybe try "python %f"


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#4 2016-02-20 05:31:42

twoion
一期一会
Registered: 2015-08-10
Posts: 3,357

Re: [SOLVED] Geany + Python = no code run??

damo wrote:

Geany has the Run/Execute keybind as F5, as expected. In the "Set Build Commands" dialog, "Execute" is set as "./%f", which implies to me that the python file needs to be executable.

Also, it needs to have a shebang at top:

#!/usr/bin/env python3

etc.

Offline

#5 2016-02-20 10:16:10

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 581
Website

Re: [SOLVED] Geany + Python = no code run??

Thanks guys.

I have looked into all of your suggestions -- to no avail :-(

If I open the code in emacs I have no problems running it from inside emacs so it's not like I don't have options but since I am not a seasoned Python coder I appreciate the extra help I get from Geany.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#6 2016-02-20 11:25:04

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: [SOLVED] Geany + Python = no code run??

See this post on crunchbang by damo
In layman terms:
when x-terminal-emulator is set to terminator in stead of xterm (which is the geany default), then geany needs to be patched to use --command in stead of -e.

@OP: if you absolutely want to use geany to launch your python scripts, then you should set x-terminal-emulator to xterm in stead of terminator.

Thanks for reporting this.

I suggest that we patch geany so that it works with terminator set as x-terminal-emulator instead of xterm. Perhaps we can even make it work no matter which emulator is set x-terminal-emulator.

After closer scrutiny the problem is with using terminator as x-terminal-emulator.
Terminator does not split the arguments of the spawned command on whitespace. xterm does.

The problem is there on a Debian stable install as well when using terminator as x-terminal-emulator.

Offline

#7 2016-02-20 17:16:33

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 581
Website

Re: [SOLVED] Geany + Python = no code run??

Bingo!

"--command" instead of "-e" was what I needed.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

Board footer

Powered by FluxBB