View Full Version : Python and Kate
K.L.
March 17th, 2010, 01:46 PM
Hello everyone!
I'm learning Python programming language and using Kate editor. I know it has plugin called External Tools which allows to run various scripts easily. I'd like to write a script which would run currently open Python script by pressing F5 key.
I've tried this (and lots of other commands), but it doesn't work.
konsole --hold -e 'python -i "%filename"'Can anyone help me out?
P.S. I'm using KDE 4.4.1
K.L.
March 18th, 2010, 07:34 AM
Anyone?
HalfEmptyHero
March 19th, 2010, 04:49 AM
You should already have 'Run Script' under external tools, and this will do what you want. The only problem is it opens a new terminal and not the one in the bottom pane, so you have to make sure you add an input() command at the end of your script so you can see what it does before it closes the terminal.
K.L.
March 19th, 2010, 08:09 AM
I have tried it with very simple Python script and it works, thanks. To keep terminal open I had to change External Tools Script from this :
cd "%directory" && chmod u+x "%filename" && konsole -e "./%filename"to this:
cd "%directory" && chmod u+x "%filename" && konsole --hold -e "./%filename"There is game engine called Panda3D (http://www.panda3d.org/), it uses Python and is very easy to learn. I've tried to run Panda's Python script, but it doesn't work, it just opens blank terminal window with no error messages.
It works with Geany, tho. Its execute script command looks like this:
python "%f"I'll mess around with Kate a bit more, if nothing helps, I'll have to stick with Geany...
Anyway, any help would be appreciated.
abalter
April 12th, 2012, 08:00 PM
I'm trying:
cd "%directory" && chmod u+x "%filename" && konsole --hold -e 'python -i "%filename"'
to run the current file which is a python script. What I get is a konsole window and a python command prompt, but the script does not run
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
hello.py:
print("hello from python")
which, of course, runs fine.
Thanks!
Powered by vBulletin® Version 4.2.2 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.