Skip to content Skip to sidebar Skip to footer

Header/footer Terminal Display

How do I create a python script where there is a static header and footer like in this image?

Solution 1:

You can use curses for python. Example:

import curses

myscreen = curses.initscr()
curses.start_color()
curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE)
y,x = myscreen.getmaxyx()
myscreen.addstr("Python curses in action!", curses.color_pair(1))
myscreen.move(y -1,0)
myscreen.addstr("Python curses in action!", curses.color_pair(1))
myscreen.refresh()
myscreen.getch()

curses.endwin()

Solution 2:

Use Curses, or ncurses with python:

http://docs.python.org/2/howto/curses.html

Post a Comment for "Header/footer Terminal Display"