Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a wxPython GUI app in Sublime Text 2

I just started to use Sublime Text 2.

I use Sublime for python, but when I use CTRL+B it does not run my wxPython GUI app. It can run a Tkinter app.

Why is this? What do I need to do to run a wxPython app from Sublime?

like image 724
chidan Avatar asked Aug 25 '12 14:08

chidan


2 Answers

To prevent the console window from popping up under Windows, it is suppressed in the Packages\Default\exec.py module. An unfortunate side effect is that wxPython gui's are also suppressed.

Just comment out the last line in the following section of the Packages\Default\exec.py file like so:

if os.name == "nt":
    startupinfo = subprocess.STARTUPINFO()
    #startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
like image 186
Krachtwerk Avatar answered Sep 24 '22 03:09

Krachtwerk


Find the file named python.sublime-build under C:\Users[USER NAME]\AppData\Roaming\Sublime Text 2\Packages\Python\

Add the following value "shell":"true"
Save the file and run your How to run a wxPython GUI app in Sublime Text 2!

like image 30
Eng Jr Avatar answered Sep 25 '22 03:09

Eng Jr