Last active
March 27, 2019 12:30
-
-
Save pelid/99922c2ed1f6bf120cdaafab9edfb445 to your computer and use it in GitHub Desktop.
Асинхронная анимация
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import curses | |
import asyncio | |
async def blink(canvas, row, column, symbol='*'): | |
'''Анимация мерцающей звезды.''' | |
while True: | |
canvas.addstr(row, column, symbol, curses.A_DIM) | |
await asyncio.sleep(0) | |
canvas.addstr(row, column, symbol) | |
await asyncio.sleep(0) | |
canvas.addstr(row, column, symbol, curses.A_BOLD) | |
await asyncio.sleep(0) | |
canvas.addstr(row, column, symbol) | |
await asyncio.sleep(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment