Python代码:
#!/usr/bin/env python3
#-*- coding = utf-8 -*-
import curses
def main(stdscr):
# Color Pair
curses.use_default_colors()
curses.init_pair(1, curses.COLOR_CYAN, curses.COLOR_BLUE)
curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_BLUE)
curses.init_pair(3, curses.COLOR_CYAN, curses.COLOR_BLACK)
height,width = stdscr.getmaxyx()
stdscr.bkgd(" ", curses.color_pair(2) )
stdscr.clear()
# Print
stdscr.addstr("널 향한 설레임을 오늘부터 우리는\n", curses.A_BOLD)
stdscr.addstr("꿈꾸며 기도하는 오늘부터 우리는 저 바람에\n", curses.A_BOLD)
stdscr.addstr("노을 빛 내 맘을 실어 보낼게\n", curses.A_BOLD)
stdscr.addstr("그리운 마음이 모여서 내리는\n", curses.A_BOLD)
stdscr.addstr(5, 0, "Me gustas tu gustas tu\n", curses.A_BOLD | curses.color_pair(1) )
stdscr.addstr("su tu tu ru 좋아해요\n", curses.A_BOLD | curses.color_pair(1) )
stdscr.addstr("gustas tu su tu ru ru\n", curses.A_BOLD | curses.color_pair(1) )
stdscr.addstr(9, 2, "+----+")
stdscr.addstr(10, 2, "| |")
stdscr.addstr(10, 3, "가")
stdscr.addstr(14, 2, "%d %d" % (width, height) )
stdscr.addstr(12, 2, "Press any key...")
stdscr.refresh()
stdscr.getkey()
curses.wrapper(main)
以腻子显示:image 1
显示在ConEmu中:image 2
显示在MATE终端中:image 3
在PuTTY中正确显示什么方法?