0
我正在嘗試Requests_Threads庫,我已經知道它將數據以我想要的方式返回給我,但它給了我一個Process finished with exit code 0
並在繼續前退出。任何人使用這個庫,並找出它?使用Requests_Threads和AsyncIO運行後退出
from requests_threads import AsyncSession
import asyncio
class apis:
def __init__(self):
self.session=AsyncSession()
self.main_out=self.session.run(self.main)
print('still alive')
async def main(self):
rs = []
for _ in range(100):
rs.append(await self.sub('thing'))
return[ (x[0].json(),x[1]) for x in rs]
async def sub(self,key):
return await self.session.get('http://httpbin.org/get'),key