# -*- coding:UTF-8 -*-
import sys,os
import subprocess
valuea="bob"
valueb="say some thing!!"
command="echo 'hello world'"
os.system(command) #返回值为0则成功
with os.popen(command,'r') as a: #返回值是文件对象
print(a.read())
a=os.popen(command,'r')
print(a.read())
data=subprocess.check_output(command,shell=True)
print( data)
command="echo 'hello %s,please %s'" % (valuea,valueb)
os.system(command) #返回值为0则成功
with os.popen(command,'r') as a: #返回值是文件对象
print(a.read())
a=os.popen(command,'r')
print(a.read())
data=subprocess.check_output(command,shell=True)
print( data)
