gpt4 book ai didi

windows - 如何从另一个 tcl 文件调用一个 tcl 文件

转载 作者:行者123 更新时间:2023-12-04 23:06:01 25 4
gpt4 key购买 nike

我需要调用一个 tcl 文件,其中包含从另一个 tcl 文件捕获图像的代码。

例如我的 image.tcl 文件代码如下:

proc image {}  { 

set time [clock format [clock seconds] -format %Y%m%d_%H%M%S]

exec ffmpeg -f dshow -s 1280x720 -i "video=Integrated Webcam" -benchmark c:/test/sample_$time.jpg

}
image


所以,我想从另一个名为 main.tcl 的 tcl 文件中调用这个 image.tcl 文件,所以 main.tcl 的代码可以如下:

proc a {}  { 

"c:/test/image.tcl"

"c:/test/video.tcl"

"c:/test/live.tcl"

}
a


当我调用 main.tcl 时,上面的 tcl 脚本应该一个接一个地运行

任何解决方案。添加代码作为答案。谢谢。

最佳答案

您需要使用 source .

在 main.tcl 中,您将拥有:

proc a {}  { 
source "c:/test/image.tcl"
source "c:/test/video.tcl"
source "c:/test/live.tcl"
}
a

关于windows - 如何从另一个 tcl 文件调用一个 tcl 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47525252/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com