You can use Python's subprocess module for this I think.