Skip to content

Instantly share code, notes, and snippets.

@fourdollars
Created January 13, 2010 11:08
Show Gist options
  • Save fourdollars/276108 to your computer and use it in GitHub Desktop.
Save fourdollars/276108 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import curses
import time
import sys
def main(curses):
pad = curses.newpad(100, 100)
for y in range(0, 100):
for x in range(0, 100):
try: pad.addch(y,x, ord('0') + (x + y ) % 10 )
except curses.error: pass
pad.refresh( 0,0, 5,5, 20,75)
time.sleep(3)
if __name__ == '__main__':
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(1)
try:
main(curses)
finally:
curses.nocbreak()
stdscr.keypad(0)
curses.echo()
curses.endwin()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment