Skip to content

Instantly share code, notes, and snippets.

@jabedude
Created January 27, 2017 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jabedude/02ce48e19252f689d80ca6065fad2bda to your computer and use it in GitHub Desktop.
Save jabedude/02ce48e19252f689d80ca6065fad2bda to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from os import system
import curses
x = 0
def main(x):
while x != ord('4'):
screen = curses.initscr()
curses.start_color()
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)
curses.init_pair(2, curses.COLOR_CYAN, curses.COLOR_WHITE)
screen.clear()
screen.border(0)
screen.addstr(2,2, "My Menu Program v0.2", curses.color_pair(1))
screen.addstr(4,4, "1 -- Add user")
screen.addstr(5,4, "2 -- Restart Apache")
screen.addstr(6,4, "3 -- Show disk space")
screen.addstr(7,4, "4 -- Exit")
screen.refresh()
x = screen.getch()
if x == ord('1'):
pass
if x == ord('2'):
pass
if x == ord('3'):
curses.endwin()
system("clear")
system("df -h")
input("Press enter...")
curses.endwin()
if __name__ == "__main__":
main(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment