Skip to content

Instantly share code, notes, and snippets.

@pelid
Last active March 27, 2019 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pelid/99922c2ed1f6bf120cdaafab9edfb445 to your computer and use it in GitHub Desktop.
Save pelid/99922c2ed1f6bf120cdaafab9edfb445 to your computer and use it in GitHub Desktop.
Асинхронная анимация
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