tcl中解释执行脚本语言TCL相关说明??
TCL语言:工具命令语言(Tool Command Language)。经常被用于快速原型开发、脚本编程、GUI 和测试等方面。
1、下载TCL解释器,下载地址如下:
https://www.activestate.com/activetcl
2、bin下的文件
wish.exe:包含了tclsh 和 tk两部分
3、如何运行脚本
新建一个简单的文本,比如test.tcl
package require Tcl
package require Tk
set a "aaaaa bbb"; # 加引号表示告诉编译器变量包括空格
puts $a;
然后运行bin目录下wish.exe,在提示符下:
%source "目录名\\test.tcl" ----注意:要用双斜线分割目录(或者用反斜杠)
然后回车就是运行结果了。
4、添加新的package
使用teacup命令安装Expect # ActiveTcl8.6版本中为什么bin目录下没有teacup??
C:\tcl\bin> teacup install Expect
Resolving Expect ... [package Expect 5.43 win32-ix86 @ https://teapot.activestate.com]
Resolving Tcl 8.4 -is package ... [package Tcl 8.5.8 _ ... Installed outside repository, probing dependencies]
Retrieving package Expect 5.43 win32-ix86 ...@ https://teapot.activestate.com ...
Ok
Installing into C:/Tcl/lib/teapot
Installing package Expect 5.43 win32-ix86
C:\Tcl\bin>
出现以上提示信息,说明安装Expect包成功了,重启wish后,就可以正常使用“package require Expect”了。