Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have made an ubuntu app using Quickly in Ubuntu12.04.In that app's main window there are several buttons.Clicking some of them opens new windows of other applications(like, firefox,gnome-sound-recorder) and clicking some of them runs commands in the background(like, html2text,espeak ). Suppose I have clicked a button which opens Sound Recorder.Now if I start recording in the Sound Recorder my main application window gets black. Again when sound recording is done and I close the Sound Recorder window, it becomes normal. I think this part of my code is responsible for this:

os.system('gnome-sound-recorder')

What statement(s) should I use instead of the above-mentioned one to prevent my main application window going black?

I have tried using the following statements:

child_pid = os.fork()
if child_pid == 0:
    os.system('gnome-sound-recorder')
else:
    return

Now, the main app window doesn't get black.But, now if I close Sound Recorder my main app window gets closed.What do I need to change?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I think you want to look at the subprocess module which allows you to spawn new processes without hanging your main app until they quit.

http://docs.python.org/2/library/subprocess.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.