954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to Start a program then another once the first is done.

The title really says it all. For example if I had a music file and I wanted to have it play all the way through then how would I make it start another music file after the first is done?

inuasha
Newbie Poster
22 posts since Dec 2011
Reputation Points: 10
Solved Threads: 3
 

I think that you are posting in the wrong forum: How is this a Python question? Ignoring that issue, you are confused again: A "music file" doesn't "play all the way through" because it holds music, but does not play it. In general terms: To have something happen after something else, you create a supervisor program that tells the system what to do in what order, and you run that program.

griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
 

I was asking how to do this with python so that is a python question...

inuasha
Newbie Poster
22 posts since Dec 2011
Reputation Points: 10
Solved Threads: 3
 

I've never used it, but the subprocess module may be what you need. It seems to feature a function that will start a subprocess and wait for the subprocess exit code. If the exit code is non-zero then the function will raise an exception.

lrh9
Posting Whiz in Training
243 posts since Oct 2009
Reputation Points: 119
Solved Threads: 36
 

No need for subprocesses to run things in sequence:

import os
os.sytem('music_player loud_music.mp3') # silly example
os.system('video_player spinning_things.mp4') # more silliness
# etc
griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
 

Thank you that is what I was looking for. I was just using music as an example of something that would take time to finish.

inuasha
Newbie Poster
22 posts since Dec 2011
Reputation Points: 10
Solved Threads: 3
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: