gpt4 book ai didi

python : get all exe files in current directory and run them?

转载 作者:太空狗 更新时间:2023-10-30 02:00:32 27 4
gpt4 key购买 nike

首先,这不是作业,我迫切需要一个脚本来执行以下操作,我的问题是,我以前从未接触过 python,所以我几乎不知道如何使用它 -我需要它通过命令行构建运行器在 TeamCity 中启动单元测试

我真正需要的是:

将运行脚本的 *.bat 文件

一个 python 脚本将:

  • 获取当前工作目录下的所有*_test.exe文件
  • 运行搜索结果的所有文件

最好的问候

最佳答案

import glob, os
def solution():
for fn in glob.glob("*_text.exe"):
os.startfile(fn)

关于 python : get all exe files in current directory and run them?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3014120/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com