Basic curses setup
This commit is contained in:
parent
c889203492
commit
1d810ee39b
2 changed files with 18 additions and 0 deletions
0
editor/__init__.py
Normal file
0
editor/__init__.py
Normal file
18
editor/main.py
Normal file
18
editor/main.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import curses
|
||||
|
||||
|
||||
def main() -> int:
|
||||
return curses.wrapper(c_main)
|
||||
|
||||
|
||||
def c_main(stdscr: "curses._CursesWindow") -> int:
|
||||
while True:
|
||||
# Update screen
|
||||
stdscr.addstr(0, 0, "Hello world!")
|
||||
|
||||
# Handle keypresses
|
||||
c = stdscr.getkey()
|
||||
if c == "q":
|
||||
break
|
||||
|
||||
return 0
|
||||
Loading…
Reference in a new issue