How to run shell commands within python

Szabolcs Nagy nszabolcs at gmail.com
Thu Feb 16 03:11:41 EST 2006


use subprocess module

from subprocess import call
call(['cmd', 'arg1', 'arg2'], stdin='...', stdout='...')
eg:
call(['ls', '-l'])




More information about the Python-list mailing list