PDA

View Full Version : Opening a program instead of a file



jaybstory
10th January 2010, 23:26
I'm wondering if there is a way to open a program instead of a file using python, qt, or qt4 designer? For example, I would like to have a button in my GUI that when clicked, it opens a media player. Thx.

boudie
11th January 2010, 06:11
You can use QProcess to do that.

jaybstory
11th January 2010, 07:06
Ok, great, I will look up that function in the docs. Thank you!

jaybstory
12th January 2010, 08:16
For future reference for anyone else with this question, I have attached some simple code for being able to open programs:


def process(self):
p = QtCore.QProcess(self)
p.setWorkingDirectory('/usr/bin/vlc') #this is where your program is located
p.start('vlc') #p.start('insert program name here')

jaybstory
14th January 2010, 04:33
I have another question, is there a way to embed the video within a created GUI? Instead of just opening a media player in another window?