import curses import time import re def ertekeles(kaja): res = re.search(r"[bcdfghjklmnpqrstvwxyz]", str(kaja)) if not res: return True else: return False stdscr = curses.initscr() curses.start_color() curses.echo() curses.cbreak() stdscr.keypad(1) curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE) curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_WHITE) topwin = curses.newwin(1, 80, 2, 0) topwin.bkgd(curses.color_pair(2)) topwin.move(0, 30) topwin.addstr('Karakterevő') topwin.refresh() mainwin = curses.newwin(15, 40, 4, 0) while True: mainwin.clear() mainwin.move(1, 5) szo = mainwin.getstr() mainwin.move(4, 5) finom = ertekeles(szo.decode()) if finom: mainwin.addstr('Finom') else: mainwin.addstr('Nem szeretem a mássalhangzókat!') mainwin.move(10,5) mainwin.addstr(szo, curses.color_pair(1)) mainwin.refresh() time.sleep(1) curses.endwin()