pythonには標準でcursesモジュールがあるものの、windowsでは使えない。
windowsで使える端末制御ライブラリは無いかなーと探してみたところ、Consoleモジュールというものが見つかった。*1
なかなかお手軽に使えるようで面白い。(テスト環境はWin2k + Python2.5.2)
文字色を変えて表示。(もちろん背景色も変えられる)
![f:id:dplusplus:20080330201059p:image f:id:dplusplus:20080330201059p:image](https://cdn-ak.f.st-hatena.com/images/fotolife/d/dplusplus/20080330/20080330201059.png)
unicode文字列を渡せば日本語表示も楽々。
![f:id:dplusplus:20080330202415p:image f:id:dplusplus:20080330202415p:image](https://cdn-ak.f.st-hatena.com/images/fotolife/d/dplusplus/20080330/20080330202415.png)
画像では分かりにくいが、キー入力によってカーソル移動。
やっぱりこういうときの現在位置表示は'@'が一番だよね!
![f:id:dplusplus:20080330201236p:image f:id:dplusplus:20080330201236p:image](https://cdn-ak.f.st-hatena.com/images/fotolife/d/dplusplus/20080330/20080330201236.png)
![f:id:dplusplus:20080330201234p:image f:id:dplusplus:20080330201234p:image](https://cdn-ak.f.st-hatena.com/images/fotolife/d/dplusplus/20080330/20080330201234.png)
とりあえず、しばらくいろいろ試してみることにした。