Version 0 of How to display the result of an external command in a widget

Updated 2001-07-20 13:48:59

pack text .text

    set result [exec my_command]

    .text insert 1.0 $result

See documentation on exec for information about how to pass in command-line arguments and "stdin" data.

[Is there no comparably reduced example already in the Wiki?]

If the process is a long running process, this will lock up your GUI. Checkout the fileevent page to see how to run the command with open & just get updates as they are available. (Change the line puts "got: $line" to .text insert end $line and possibly add a .text see end)

bbh


What about a tk app that talks to a running tcl app in a seperate process - is there an example that shows doing this? Well, yes, although perhaps it's not obviously labeled that way yet. "Inventory of IPC methods" aims to point to all the ways to get two such processes in communication.