我想直接从Ruby调用现有的TCL PROC,或者使用BASH命令,并将结果返回到Ruby变量。有没有办法可靠地做到这一点?

最佳答案

当然:

tcl_file = "./file.tcl"
tcl_code = "source #{tcl_file}; name_of_proc_to_call"
result = IO.popen("tclsh", "r+") {|p|
  p.puts tcl_code
  p.close_write
  p.read
}

关于ruby - 我可以从ruby调用tcl proc吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50276454/

10-16 22:23