notcurses/cffi/notcurses-pydemo

30 lines
636 B
Plaintext
Raw Normal View History

2020-02-11 01:57:06 +00:00
#!/usr/bin/python3
2020-02-11 01:51:08 +00:00
import locale
from notcurses import notcurses
def demo():
2020-02-20 05:25:08 +00:00
nc = notcurses.Notcurses()
stdplane = nc.stdplane()
dims = stdplane.getDimensions()
2020-02-20 05:25:08 +00: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 05:25:08 +00:00
b = b + 2
if b == 256:
b = 0
g = g + 2
if g == 256:
g = 0
r = r + 2
nc.render()
2020-02-11 01:51:08 +00:00
locale.setlocale(locale.LC_ALL, "")
demo()