ti serve la funzione popen del modulo os http://docs.python.org/library/os.html#os.popen