#!/usr/bin/python
from subprocess import *
from shlex import *
command = "ls -l"
print command
output = Popen(split(command), stdout=PIPE, stderr=PIPE)
outputData = output.communicate()[0]
returncode = output.returncode
http://docs.python.org/library/subprocess.html
沒有留言:
張貼留言