With python, the -i option accomplishes this.
Is there any way to do this beyond asking users to put 'source
myInit.tcl' in their ~/.tclshrc file? If you feel that asking users to
do this is indeed the correct approach, I would be interested to hear
your opinion.
> I would like to start tclsh, execute an initialization script, and then
> enter interactive mode.
As long as the Tcl interactive read-eval-print loop is not exposed at
script level (might be good :)), one can write a quick one oneself:
while 1 {
puts -nonewline "% "; flush stdout ;#-- prompt - can be more
elaborated
gets stdin line
catch $line res
puts $res
}
On UNIXes you can do this with
cat myscript.tcl - | tclsh
You have to put a "set tcl_interactive 1" into your myscript.tcl to get
tclsh's usual prompt.