notcurses/cffi/notcurses-pydemo

30 lines
636 B
Plaintext
Raw Permalink Normal View History

2020-02-10 20:57:06 -05:00
#!/usr/bin/python3
2020-02-10 20:51:08 -05:00
import locale
from notcurses import notcurses
def demo():
2020-02-20 00:25:08 -05:00
nc = notcurses.Notcurses()
stdplane = nc.stdplane()
dims = stdplane.getDimensions()
2020-02-20 00:25:08 -05:00
r = 0x80
g = 0x80
b = 0x80
for y in range(dims[0]):
for x in range(dims[1]):
stdplane.setFgRGB(r, g, b)
stdplane.setBgRGB(b, r, g)
stdplane.putEGCYX(y, x, "X")
2020-02-20 00:25:08 -05:00
b = b + 2
if b == 256:
b = 0
g = g + 2
if g == 256:
g = 0
r = r + 2
nc.render()
2020-02-10 20:51:08 -05:00
locale.setlocale(locale.LC_ALL, "")
demo()