import subprocess
import asyncio
import time
def get_cmd(cmd):
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
out, err = proc.comm
python协程 同步函数的异步使用
最新推荐文章于 2024-04-08 03:00:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
import subprocess
import asyncio
import time
def get_cmd(cmd):
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
out, err = proc.comm