python 执行系统文件

        from subprocess import Popen,PIPE

        node  = 'node test.js {sessionId} "{body}" {action}'.format(sessionId=self.sessionId,body=self.body,action=self.action)
        data = Popen(node,stdout=PIPE,stderr=PIPE)
        a,b = data.communicate()
        # print(a.decode('utf-8'))
        print(b)

 

posted @ 2020-07-07 09:27  酷酷的城池  阅读(147)  评论(0编辑  收藏  举报