I\'ll preface this by saying it\'s a homework assignment. I don\'t want code written out for me, just to be pointed in the right direction.
Check out the subprocess documentation.