tcl

proc load_file {} {
    set file [tk_getOpenFile]
    set f [open $file]
    text .t0
    pack .t0
    set line_count 1
    while {[gets $f line] >= 0} {
        .t0 insert end "$line\n"
        incr line_count
    }
    close $f
}
button .b -text "Open" -command load_file
pack .b

tclはおもしろいんだけど、一体どんな場合に使うんだろうと、ずっとピンと来ない。とりあえずActiveStateからダウンロードしてデモを見てみる。すごい。すごいけど、これをどうすればいいのだろう・・・