用 aiofiles 模块的 asyncio.to_thread() 方法将同步文件操作转换为异步操作
importaiofilesimportreasyncdefdownload_text_to_file(url,name):asyncwithaiohttp.ClientSession()assession:asyncwithsession.get(url)asresponse:text=awaitresponse.text()obj_content=re.compile(r"content:'(