相关疑难解决方法(0)

在Tkinter.Tcl()中使用Python函数

  1. 我有一堆Python函数.让我们给他们打电话foo,barbaz.它们接受可变数量的字符串参数,并执行其他复杂的操作(如访问网络).

  2. 我希望"用户"(让我们假设他只熟悉Tcl)使用这些函数在Tcl中编写脚本.

以下是用户可以提出的一个示例(取自Macports):

post-configure {
    if {[variant_isset universal]} {
        set conflags ""
        foreach arch ${configure.universal_archs} {
            if {${arch} == "i386"} {append conflags "x86 "} else {
                if {${arch} == "ppc64"} {append conflags "ppc_64 "} else {
                    append conflags ${arch} " "
                }
            }
        }

        set profiles [exec find ${worksrcpath} -name "*.pro"]
        foreach profile ${profiles} {
            reinplace -E "s|^(CONFIG\[ \\t].*)|\\1 ${conflags}|" ${profile}

            # Cures an isolated case
            system "cd ${worksrcpath}/designer && \
                    ${qt_dir}/bin/qmake …
Run Code Online (Sandbox Code Playgroud)

python integration dsl tcl

3
推荐指数
1
解决办法
4240
查看次数

标签 统计

dsl ×1

integration ×1

python ×1

tcl ×1