当前位置:   article > 正文

Python执行Dos命令

Python执行Dos命令
# -*- coding: utf-8 -*-
# 执行dos命令
import os


class DosCmd:
    def excute_cmd_result(self, command):
        result_list = []
        # popen方式
        result = os.popen(command).readlines()
        for i in result:
            if i == '\n':
                continue
            result_list.append(i.strip('\n'))
        return result_list
        
    # os.system的方式
    def excute_cmd(self, command):
        os.system(command)

    def walle(self):
        apk_name = input("输入基础包全称:")
        command = "java -jar walle-cli-all.jar batch2 -f config.json " + str(apk_name) + " Results"
        self.excute_cmd_result(command)
        input("\n\n渠道包已放到Results文件夹下~\n点击任意键退出...")

if __name__ == '__main__':
    dos = DosCmd()
    dos.walle()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/829733
推荐阅读
相关标签
  

闽ICP备14008679号