python 学习os.systemsystem和os.popen

两个都可以执行系统命令,但是如果想要获取到命令的输出内容就要用到os.popen

 

com=os.popen('ls')

print(com.readlines())

 

posted @ 2020-12-02 15:08  没有尾巴的狗  阅读(132)  评论(0)    收藏  举报