Created
April 11, 2016 23:06
-
-
Save alanduan/257879e02d29debc0306eeeecbf90681 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 time | |
from random import randint | |
import curses | |
from console import ConsoleDisplay | |
if __name__ == '__main__': | |
rows, cols = (25, 80) | |
def func(stdscr, rows, cols): | |
console = ConsoleDisplay(stdscr, rows, cols) | |
while True: | |
vram = [chr(randint(0x20, 0x7f)) for i in xrange(rows * cols)] | |
console.refresh(vram) | |
time.sleep(0.1) | |
#curses.wrapper(func) | |
#import sys; sys.exit(1) | |
import mmap | |
with open('console.ram', 'r+b') as f: | |
m = mmap.mmap(f.fileno(), rows * cols) | |
while True: | |
msg = raw_input() | |
m.write(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment