Now when we execute a python script in geany, it opens another terminal and execute the python script there. Instead of this I want to execute python script in a interactive python console in the status bar. I have tried Geanypy and it adds an interactive python console in the satus bar but it works independently to geany's editor.
![Geany](https://hackadaycom.files.wordpress.com/2017/04/geany-with-interactive-but-n...)
Looking at [Python documentation](https://docs.python.org/3/using/cmdline.html) how would you run a file in an interactive console? Maybe the `-i` option is what you want?
If you can figure out a command to do what you want you can set `Edit->Preferences->Terminal->Execute programs in the VTE` and `Don't use run script` to run the command in the terminal tab, but the command must be a shell command, you will have to exit Python each run because the directory is set to the files directory each run by the shell command `cd dir` issued before the execute command.
``` Maybe the -i option is what you want? ``` Tried it, I want a docked terminal/console . This is not a solution I want
``` If you can figure out a command to do what you want you can set Edit->Preferences->Terminal->Execute programs in the VTE and Don't use run script to run the command in the terminal tab ``` Yes tried this method also and as you rightly pointed out I have to exit python shell everytime I execute a python script. This makes programming in python difficult. Except the exiting from python shell part I loved this approach. Is there any workaround for this problem?
``` Maybe the -i option is what you want? ``` Tried it, I want a docked terminal/console . This is not a solution I want
``` If you can figure out a command to do what you want you can set Edit->Preferences->Terminal->Execute programs in the VTE and Don't use run script to run the command in the terminal tab ``` Yes tried this method also and as you rightly pointed out I have to exit python shell everytime I execute a python script. This makes programming in python difficult. Except the exiting from python shell part I loved this approach. Is there any workaround for this problem?
It doesn't make much sense to run a script/file in an interactive interpreter. If you just want to send text to the Python REPL, then start the repl by running `python` in the builtin terminal and then use the `Send selection to Terminal` menu item/keybinding. If you just want to execute your script, just set the option to run command in VTE and it will just run your script when you execute it.
Maybe if you could explain exactly step by step in detail what you want to be able to do, and what the result should be, it would help clarify.
``` then start the repl by running python in the builtin terminal and then use the Send selection to Terminal ``` I want to use Geany as a full blown python IDE. I already have a keybinding `Alt+Shift+F5` for sending selected lines to terminal. This is currently how I run python script.
If I want to run full script, In the VTE I type `python` and go to python shell. Then select all python code and then send all this code to terminal by `Alt+Shift+F5` where it executes. This is a three step execution which I want to simplfy it into one step by executing the script using `Run` icon in toolbar. There are times when I forgot to start `python` shell and send the whole code to terminal `Alt+Shift+F5` it then hangs Geany.
@potholiday I pointed to the Python documentation because AFAICT there is no way of making Python do what you want.
And as I pointed out, Geany knows about talking to a bash shell, not a Python shell, since a bash shell is language independent and Geany is a multi-language tool, not just a Python tool.
There are times when I forgot to start python shell and send the whole code to terminal Alt+Shift+F5 it then hangs Geany.
Yes I can imagine a Python program would give bash indigestion :) but it shouldn't hang all of Geany, just the run part until bash returns.
Closed #1823.
@potholiday with the preferences @elextr mentioned to change, when you press F5 (or Build->Execute) in Geany it will execute your script in the terminal tab. What about that doesn't do what you want? It's not the _interactive_ Python shell, but it's what you describe and how any IDEs work.
github-comments@lists.geany.org