Update README
This commit is contained in:
12
README.md
12
README.md
@@ -45,10 +45,10 @@ while chat.is_alive():
|
|||||||
#other background operation here.
|
#other background operation here.
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
def func(chatdata):
|
def func(data):
|
||||||
for c in chatdata.items:
|
for c in data.items:
|
||||||
print(f"{c.datetime} [{c.author.name}]-{c.message} {c.amountString}")
|
print(f"{c.datetime} [{c.author.name}]-{c.message} {c.amountString}")
|
||||||
chat.tick()
|
data.tick()
|
||||||
```
|
```
|
||||||
|
|
||||||
### asyncio context:
|
### asyncio context:
|
||||||
@@ -62,10 +62,10 @@ async def main():
|
|||||||
#other background operation here.
|
#other background operation here.
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
|
|
||||||
async def func(chat)
|
async def func(data)
|
||||||
for c in chat.items:
|
for c in data.items:
|
||||||
print(f"{c.datetime} [{c.author.name}]-{c.message} {c.amountString}")
|
print(f"{c.datetime} [{c.author.name}]-{c.message} {c.amountString}")
|
||||||
await chat.tick_async()
|
await data.tick_async()
|
||||||
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.run_until_complete(main())
|
loop.run_until_complete(main())
|
||||||
|
|||||||
Reference in New Issue
Block a user