Paid Apps Gone Free - PAGF (Beta)

How to Get Python Build Results in Terminal with Sublime Text 2

Sublime Text 2 is a powerful text editor for Linux that comes with lots of plugins and customization options.

The text editor is pretty good, however, one thing I don't like about it is that build/execute results are shown in its native console rather than system default shell like gnome-terminal. 

This problem can be easily solved by creating a new build file and adding following to it:

{
"cmd": ["gnome-terminal -e \"python $file\""],
"shell": true
}

Note that using this this method, gnome-terminal will be closed when the process is terminated. If you like a Geany like approach where terminal stays open for reviewing results, we can do the same using Geany's run script.

Create a new bash script with following in it:

#!/bin/sh

python $1

echo "

------------------
(program exited with code: $?)"


echo "Press return to continue"
dummy_var=""
read dummy_var

Now create new sublime build file with following in it:

{
"cmd": ["gnome-terminal -e \"/your/run/script.sh $file\""],
"shell": true
}

Replace path of your own run script in above command. Make sure your script has executable permissions.

Lastly, Sublime Text's build console will still popup at the bottom. To disable it for build results, add this to your user settings file:

"show_panel_on_build": false

0 comments:

Follow Us !!

Follow on TwitterFollow on FacebookGet PAGF Android App on Play StoreSubscribe via emailSubscribe to RSSFollow on Google Plus