首页 > 编程语言 > 详细

python 3中 的subprocess

时间:2018-12-03 18:38:10      阅读:130      评论:0      收藏:0      [点我收藏+]

commands好像python3.6被去除了,它现在被subprocess替代了

FUNCTIONS
    getoutput(cmd)
        Return output (stdout or stderr) of executing cmd in a shell.

    getstatus(file)
        Return output of "ls -ld <file>" in a string.

    getstatusoutput(cmd)
        Return (status, output) of executing cmd in a shell.



import subprocess

(status, output) = subprocess.getstatusoutput(‘redis-cli -h 127.0.0.1 -p 6379 -n 0 keys *‘)
print (status, output)

 

python 3中 的subprocess

原文:https://www.cnblogs.com/BlueFire-py/p/10059980.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!