run_cmd_script.py 980 bytes
import os
import sys
current_directory = os.path.dirname(os.path.realpath(sys.argv[0]))
from common.common_func import commonFuc
pro_path=commonFuc().get_pro_path()
file_path=pro_path
print(file_path)
import subprocess
# 执行cmd命令
# def execute_command(command):
#     # 使用subprocess.run来执行命令
#     result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
#     # 输出命令的返回结果
#     print(result.stdout)
#     # 如果有错误,打印错误信息
#     if result.stderr:
#         print(result.stderr)
# 使用示例
# command = "cd"  # 这是一个cmd命令,在Windows上列出当前目录下的文件和文件夹
# execute_command(command)
def execute_command(command):
    os.chdir(pro_path)
    os.system("dir")
    # command="python runner.py tag id2297-10 debug sit"
    # print(command)
    os.system(command)
# execute_command("python runner.py tag id2297-10,id2263-80 debug sit")