按以往python2的习惯编码输出报错 #-*- coding:utf-8 -*- ''' Created on 2018年7月21日 @author: lenovo ''' import os import sys import subprocess from uiautomator import device as d cmd = r'adb install F:\听力.apk' info = subprocess.check_output(cmd).split("\r\n") p
一.常见subprocess方法 1.subprocess.getstatusoutput(cmd) 官方解释: Return (exitcode, output) of executing cmd in a shell. Execute the string 'cmd' in a shell with 'check_output' andreturn a 2-tuple (status, output). The locale encoding is usedto decode the out
def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr