M
Marco
Hi, I wanna write a simple curses program, but somethings confuse
me, my code here:
#!/usr/bin/python
import os
import sys
import time
import curses
class CursesObject( object ):
def __init__(self):
self.STDSCR = curses.initscr()
curses.noecho()
curses.cbreak()
self.STDSCR.keypad(1)
def __del__(self):
self.STDSCR.keypad(0)
curses.nocbreak()
curses.echo()
curses.endwin()
c1 = CursesObject()
time.sleep(1)
I donot know what happen, but in __del__ function, curses become None??!!
Thank you VERY much!
me, my code here:
#!/usr/bin/python
import os
import sys
import time
import curses
class CursesObject( object ):
def __init__(self):
self.STDSCR = curses.initscr()
curses.noecho()
curses.cbreak()
self.STDSCR.keypad(1)
def __del__(self):
self.STDSCR.keypad(0)
curses.nocbreak()
curses.echo()
curses.endwin()
c1 = CursesObject()
time.sleep(1)
I donot know what happen, but in __del__ function, curses become None??!!
Thank you VERY much!