asyncio.create_subprocess_exec在Windows上无法运行?(批处理脚本)
创始人
2024-09-21 05:00:46
0

在Windows上使用asyncio.create_subprocess_exec运行批处理脚本时,需要先使用"cmd /c"命令将脚本包装起来。例如:

import asyncio
async def run_command():
    p = await asyncio.create_subprocess_exec('cmd', '/c', 'path\\to\\your\\script.bat')
    await p.wait()
asyncio.run(run_command())

其中,"path\to\your\script.bat"是你想要运行的批处理脚本的完整路径。通过将"cmd /c"添加到create_subprocess_exec()参数中,可以将批处理脚本包装为Windows命令行可识别的格式。

相关内容

热门资讯

透视有挂!wepoker怎么设... 透视有挂!wepoker怎么设置房间,wepoker怎么设置透视(详细有辅助工具)wepoker怎么...
透视好友!aapoker透视怎... 透视好友!aapoker透视怎么用(透视)aapoker辅助工具安全吗,普及教程(有挂介绍)1、任何...
透视计算!wepoker破解工... 透视计算!wepoker破解工具,wepoker一直输的号能继续打吗(详细辅助器免费安装)1、操作简...
透视脚本!aapoker怎么设... 透视脚本!aapoker怎么设置抽水(透视)aapoker辅助插件工具,扑克教程(有挂教程);1、用...
透视教程!wepoker轻量版... 透视教程!wepoker轻量版书签,wepoker私人局辅助器怎么用(详细轻量版辅助)1、完成wep...
透视美元局!aapoker辅助... 透视美元局!aapoker辅助软件合法吗(透视)aapoker怎么开辅助器,扑克教程(有挂细节)1、...
透视智能ai!wepoker软... 透视智能ai!wepoker软件辅助程序,wepoker私人定制透视(详细辅助器免费安装);1、打开...
透视安装!aapoker透视插... 透视安装!aapoker透视插件(透视)aapoker辅助器是真的吗,wepoke教程(有挂细节)1...
透视游戏!we-poker辅助... 透视游戏!we-poker辅助,wejoker辅助软件价格(详细安装教程);1、每一步都需要思考,不...
透视最新!aapoker脚本(... 透视最新!aapoker脚本(透视)aapoker怎么拿好牌,介绍教程(有挂脚本)小薇(透视辅助)致...