python协程 同步函数的异步使用
import subprocess
import asyncio
import time
def get_cmd(cmd):
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
out, err = proc.communicate()
return out, err
async def main(cmd):
l = asyncio.get_event_loop()
future =
原创
2021-09-21 22:17:56 ·
823 阅读 ·
0 评论