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