I just installed geany, tried both 1.23 and 1.27. Saved a script as test.py, when I press execute, the 3 gears icon briefly changes to a red cross icon and then goes back to 3 gears. No output anywhere.
The version number of GTK+ is 2.24.23
Doing this in Ubuntu 64bit 14.04.
The script is a simple Hello World.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019
Can you run your script from the command line `python test.py`?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216210934
It prints the message, no problem.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216211297
user@user-desktop:~$ geany -V geany 1.27 ((gerado em 2016-03-13 com)GTK 2.24.23, GLib 2.40.2) user@user-desktop:~$ python python python2 python2.7 python3 python3.4 python3.4m python3m user@user-desktop:~$ python3 python/testes.py Hello Python World! user@user-desktop:~$ python python/testes.py Hello Python World!
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216212444
Ok, when you said "No output anywhere" does that include any error messages in Menu->Help->Debug Messages?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216218163
When I open geany there are some messages, but none that are generated when executing I'm afraid. Nevertheless, here's the content:
12:58:14: Geany INFO : Geany 1.27, pt_PT.UTF-8 12:58:14: Geany INFO : GTK 2.24.23, GLib 2.40.2 12:58:14: Geany INFO : System data dir: /usr/share/geany 12:58:14: Geany INFO : User config dir: /home/user/.config/geany 12:58:14: Geany INFO : System plugin path: /usr/lib/x86_64-linux-gnu/geany 12:58:14: Geany INFO : Added filetype Cython (61). 12:58:14: Geany INFO : Added filetype Graphviz (62). 12:58:14: Geany INFO : Added filetype CUDA (63). 12:58:14: Geany INFO : Added filetype Clojure (64). 12:58:14: Geany INFO : Added filetype Genie (65). 12:58:14: Geany INFO : Added filetype Scala (66). 12:58:14: Geany INFO : Added filetype JSON (67). 12:58:14: Geany INFO : /home/user/python/testes.py : Python (UTF-8) 12:58:14: Geany INFO : Loaded /usr/share/geany/python.tags (Python), 5964 symbol(s).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216218524
Ok, just in case there is something in your config that is strange, can you try it running geany from the command line `geany -c /tmp/xxx` and open and run your file without changing anything else (where /tmp/xxx is something that does NOT exist).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216219378
Still same results - however there was perhaps a clue in the terminal:
error: Additional unexpected arguments found: ['/tmp/geany_run_script_F364GY.sh']
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216220642
What is the Menu->Edit->Preferences->Tools->Terminal setting?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216222041
It's the default setting:
`x-terminal-emulator -e "/bin/sh %c"`
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216222576
Looks like `x-terminal-emulator` doesn't like arguments, see [here](https://groups.google.com/forum/#!topic/linux.debian.user/B8yZD3U7k2A)
Maybe try another terminal that is properly xterm compatible.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216223681
try changing it to `xterm -e "/bin/sh %c"`. our default uses `xterm`, but some OS like Debian change it to `x-terminal-emulator` to try and use the user's preferred one. This is good in theory, but the wrapper is not good when it maps to some non-xterm-like terminals, including Konsole among others IIRC. It might be possible to use your preferred terminal anyway, but it might require using a slightly tuned command.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216224292
You might have to install xterm, I don't think Ubuntu includes it by default any more.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216225142
I tried changing to `xterm -e "/bin/sh %c"` and that worked flawlessly.
It's strange though - I have a different computer with exactly the same build. In that computer everything runs no problem. Didn't have to change to xterm. Neither of them seem to have x-terminal-emulator.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216232662
Try and see the output of `$ update-alternatives --display x-terminal-emulator` on both machines: it's likely they don't use the same wrapper to implement it.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216233073
You are correct. On the machine that "is working", the wrapper is gnome-terminal, on the one where it isn't working, it's terminator.
Can I fix this without uninstalling terminator?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216234394
Sure, using `sudo update-alternatives --config x-terminal-emulator` (interactive), or directly using `sudo update-alternatives --set x-terminal-emulator /usr/bin/gnome-terminal.wrapper`.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216235248
Although that will possibly make other things use gnome-terminal in preference to terminator, not just geany.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216235911
True; but if the wrapper doesn't really work as expected it's likely to also break other things. Also, it's generally possible to select the desktop's preferred terminal emulator separately, which can stay the same (with likely the same kind of issues if it's used for anything but simply spwaning the terminal itself)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216236635
Thanks, it is now working (almost) entirely as expected!
I am having a different problem now, related to the coding. I checked the document coding option, it is set to UTF8, which I believe is regular. However, when running this little script, I get the following message: ```
File "listas.py", line 8 SyntaxError: Non-ASCII character '\xc3' in file listas.py on line 8, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details ```
Should I close this issue and open a new one?
Thanks for being so helpful!
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216238295
Yes, open a new one, the terminal emulator thing is likely to reoccur, so we want this to refer to.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216240811
that's a Python question now :) Python needs to know in which encoding the file it runs is, and this defaults to ASCII. UTF-8 is compatible with ASCII, but only for the characters that are part of ASCII -- obviously. So, if you use any non-ASCII characters (i.e. accented letters), you'll have to [tell Python your file is encoded in UTF-8](https://docs.python.org/2/howto/unicode.html#unicode-literals-in-python-sour...). To do that, add
```python # -*- coding: utf-8 -*- ``` just below your shebang line (`#!/...python`), e.g. 2nd line probably.
Note that Python3's (current version of Python) default is UTF-8, so if you used it instead of Python2 it'd work without out of the box ;)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216240962
Closed #1019.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#event-647602646
Thanks, elextr and b4n!
Just a final remark regarding the coding issue. Amidst my confused troubleshooting, I changed the execute commands to python, rather than python3. Reverting this fixed it!
Thanks again :+1:
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1019#issuecomment-216242641
github-comments@lists.geany.org