cursesというライブラリを使えば、ターミナル上でGUIのようなインターフェイスが使えます。
テキストエディタのnano
などのようなアプリケーションも作れます。
以下はpythonでの例です。
Python
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import curses
5from curses import wrapper
6import time
7from datetime import datetime
8
9# addstrでの文字化け対策
10# http://d.hatena.ne.jp/SumiTomohiko/20070518/1179499889
11import locale
12locale.setlocale(locale.LC_ALL, "")
13
14def main(stdscr):
15 stdscr.clear()
16 stdscr.nodelay(True) # ユーザー入力待たない
17 curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)
18
19 stdscr.addstr( 0, 0, 'キー入力で終了', curses.A_BOLD)
20 x = 0
21 while True:
22
23 try:
24 inp = stdscr.getkey()
25 if inp:
26 break
27 except curses.error:
28 pass
29
30 stdscr.addstr( 1, 0, datetime.now().strftime("%Y/%m/%d %H:%M:%S"), curses.color_pair(1))
31
32 # アニメーション
33 stdscr.addstr( 2, x, ' ')
34 x += 1
35 if x > 10:
36 x = 0
37 stdscr.addstr( 2, x, '+')
38
39 stdscr.refresh()
40 time.sleep(0.1)
41
42 stdscr.nodelay(False)
43
44if __name__ == '__main__':
45 wrapper(main) # 初期化、エラー処理などをラッパにまかせる
46 print('end')
参考:Python で Curses プログラミング