简体   繁体   English

需要从python服务器运行TCL脚本

[英]Need to run TCL script from python server

I need to run TCL script from python server which uses framework written in Python. 我需要从python服务器运行TCL脚本,该服务器使用以Python编写的框架。 TCL scripts uses a framework written in TCL. TCL脚本使用以TCL编写的框架。 So is there a way where i can integrate TCL framework to python framework and execute my scripts. 因此,有没有一种方法可以将TCL框架集成到python框架并执行我的脚本。

It seems that Tkinter is what you are looking for. 似乎Tkinter是您想要的。

If you have a file of Tcl code in a file called foo.tcl and you want to call the Tcl function foo_bar then: 如果在名为foo.tcl的文件中有一个Tcl代码文件,并且您想调用Tcl函数foo_bar,则:

import Tkinter
root = Tkinter.Tk()
root.tk.eval('source {foo.tcl}')
root.tk.eval('foo_bar')

I'd take a look into it: 我来看看:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM