Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Keyboard-macros/Python/keyboard-macros.py
Normal file
21
Task/Keyboard-macros/Python/keyboard-macros.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python
|
||||
import curses
|
||||
|
||||
def print_message():
|
||||
stdscr.addstr('This is the message.\n')
|
||||
|
||||
stdscr = curses.initscr()
|
||||
curses.noecho()
|
||||
curses.cbreak()
|
||||
stdscr.keypad(1)
|
||||
|
||||
stdscr.addstr('CTRL+P for message or q to quit.\n')
|
||||
while True:
|
||||
c = stdscr.getch()
|
||||
if c == 16: print_message()
|
||||
elif c == ord('q'): break
|
||||
|
||||
curses.nocbreak()
|
||||
stdscr.keypad(0)
|
||||
curses.echo()
|
||||
curses.endwin()
|
||||
Loading…
Add table
Add a link
Reference in a new issue