import os,re
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename='myapp.log',
filemode='a')
cmd1 = r'adb shell*********' #信息安全,恕不能提供全部字段
cmd2 = r'adb shell wl txchain 1'
cmd3 = r'adb shell wl rxchain 1'
args = (cmd1,cmd2,cmd3)
###########################################################
#对args还不是特别的理解,请大神多指点!诚恳希望您能对该脚本提出建设性的改进意见,谢谢!
###########################################################
def changewifi(firstcmd,*args):
s = os.system(firstcmd)
if s ==0:
print('success,going on...')
print(firstcmd)
logging.info(firstcmd)
for lefttuple in args:
os.system(lefttuple)
print(lefttuple)
logging.info(lefttuple)
else:
print('please check if your phone is offline')
cw = changewifi(cmd1,cmd2,cmd3)
转载于:https://www.cnblogs.com/Pyguo/p/9085496.html