Код: Выделить всё
import asyncio
from binance.client import AsyncClient
async def get_data(client):
res = await client.get_klines(symbol='BTCUSDT', interval='15m', limit=99)
print(res)
async def main():
client = await AsyncClient.create()
asyncio.create_task(get_data(client=client))
asyncio.run(main())
Код: Выделить всё
import asyncio
from binance.client import AsyncClient
async def get_data(client):
res = await client.get_klines(symbol='BTCUSDT', interval='15m', limit=99)
print(res)
async def main():
client = await AsyncClient.create()
await get_data(client=client)
asyncio.run(main())
Подробнее здесь: https://stackoverflow.com/questions/791 ... nd-asyncio
Мобильная версия