标签:
import subprocess output = subprocess.Popen([‘ls‘,‘-l‘],stdout=subprocess.PIPE,shell=True).commun icate() print output[0]
import commands return_code, output = commands.getstatusoutput(‘ls -l‘)
3.
import os process = os.popen(‘ls -l‘) # return file output = process.read()
process.close()
标签:
原文地址:http://www.cnblogs.com/snow-backup/p/5035792.html