python传递参数给shell

#格式化字符
print "hello, %s" % ('mm')

#传递参数
 n="192.168.200.2"
os.popen('ping %s -c 2' % (n)).readlines()

 

posted on 2016-01-04 14:15  momingliu11  阅读(1618)  评论(0编辑  收藏  举报