OnuchinVA Asked:2022-06-02 17:15:16 +0000 UTC2022-06-02 17:15:16 +0000 UTC 2022-06-02 17:15:16 +0000 UTC 如何在没有名称的情况下获取 tcl 脚本的路径? 772 我使用的是 Xilinx Vivado 2020。 如何在没有脚本本身名称的情况下获取 tcl 脚本的路径? tcl 1 个回答 Voted Best Answer OnuchinVA 2022-06-02T17:15:16Z2022-06-02T17:15:16Z 将此用于 Tcl 版本 8.3(在 Vivado 2020 中): set ScriptDir [file normalize [file dirname [info script]]] puts ${ScriptDir} 值: info script- 给出脚本的完整路径及其名称; file dirname- 给出脚本的相对路径,没有名称; file normalize- 将相对路径转换为绝对路径。
将此用于 Tcl 版本 8.3(在 Vivado 2020 中):
值:
info script- 给出脚本的完整路径及其名称;file dirname- 给出脚本的相对路径,没有名称;file normalize- 将相对路径转换为绝对路径。