However, since I did use expect and spent some time learning Tcl, I actually did appreciate one useful thing about it. It's very easy for me to in-line Tcl code into, say, a configuration, parse it with the help of `[info complete]`, attach it to a list and then expand that list `{*}$some_list` as an argument to `expect` or `interact`. I can now have UART specific macros that are bound to keystrokes like Ctrl-t x. Sure I could do something like that in python, but it probably wouldn't be as clear-cut as:
# Fix terminal row/col height for less, vi, etc
# type Ctrl-t r
bind[r] = {
# depends on xterm size info, may not be universal
send "\{ "
send {old=$(stty -g);}
send {stty raw -echo min 0 time 5;}
send {printf '\033[18t' > /dev/tty;}
send {IFS=';t' read -r _ rows cols _ < /dev/tty;}
send {stty "$old";}
send {stty cols "$cols" rows "$rows";}
send {unset old cols rows;}
send {shopt -s checkwinsize;}
send {clear;}
send " \}\r"
}