현재 기계의 상태를 콘솔에 출력하는 상태 기반의 Python 프로그램을 작성하고 있습니다. 이것은 로그로서 유용하지만 사용자 친화적 인 인터페이스는 아닙니다.Python ncurses 템플릿, 테이블
파이썬에서 ncurses를 사용하는 좋은 예가 있는지 알고 싶습니다. 테이블에 변화하는 정보 (예 : 상태 정보)를 제공하는 OOP의 것이 좋을 것 같습니다.
이미 파이썬에서 curses
패키지를 시도했지만, 원하는대로 OO가 아닙니다.
이
스트림이 현재 모습입니다 같은 :manager: st_machine_01 state EXIT
manager: st_machine_02 state EXIT
manager: st_machine_03 state GET_LIST_PAGES
manager: st_machine_04 state EXIT
manager: st_machine_05 state EXIT
manager: st_machine_06 state EXIT
manager: st_machine_07 state GET_LIST_PAGES
난 :
manager: st_machine_01 state INITIALISE
manager: st_machine_01 state GET_LIST_PAGES
manager: st_machine_02 state EXIT
manager: st_machine_03 state INITIALISE
manager: st_machine_03 state GET_LIST_PAGES
manager: st_machine_04 state EXIT
manager: st_machine_05 state INITIALISE
manager: st_machine_05 state GET_LIST_PAGES
manager: st_machine_01 state GET_LIST_PAGES
manager: st_machine_05 state GET_LIST_PAGES
manager: st_machine_05 state EXIT
manager: st_machine_01 state GET_LIST_PAGES
manager: st_machine_06 state INITIALISE
manager: st_machine_06 state GET_LIST_PAGES
manager: st_machine_01 state GET_LIST_PAGES
manager: st_machine_06 state GET_LIST_PAGES
manager: st_machine_01 state EXIT
manager: st_machine_06 state GET_LIST_PAGES
manager: st_machine_07 state INITIALISE
manager: st_machine_07 state GET_LIST_PAGES
manager: st_machine_06 state GET_LIST_PAGES
manager: st_machine_06 state EXIT
위 스트림의 마지막 시점에서 렌더링 ncurses를 "테이블"과 같이 보일 것입니다 반면 Python 2.7 64 비트, Windows 7 64 비트에서이 작업을 수행하려고합니다.
기계가 제대로 작동하면 꽤 잘 보입니다. 디스플레이를 7 행과 상태 또는 cmd 행으로 제한하면 상태가 변경 될 때마다 화면을 brifly 플래싱 할 수 있습니다. 새로운 상태를 빨리 재 인쇄하면 매우 멋지게 보일 것입니다. 마지막 행에 로그 항목을 추가 할 수 있습니다.'st_machine_05가 상태 종료에서 Get_List_Pages로 변경되었습니다 .' ... – Dru