あなたは、Pythonインタプリタを起動するサンプルスクリプトを読んで、関数を呼び出し、その結果を印刷する必要がありますように見えます。複素数のに渡される引用であるため
package require tclpython
set a 3
set b 5
# Make a Python system within this process
set py [python::interp new]
# Run some code that doesn't return anything
$py exec {import sample}
# Run some code that does return something; note that we substitute a and b
# *before* sending to Python
set result [$py eval "sample.f2($a,$b)"]
puts "result = $result"
# Dispose of the interpreter now that we're done
python::interp delete $py
注意すべき主なもの:あなたはインプロセス評価を行うことができ、tclpythonで
$ tclsh
% set a 3
3
% set b 5
5
% set result [exec python -c "import sample; print sample.f2($a,$b)"]
8
複数のプロセスまたは1つのプロセスを含むソリューションが必要ですか? –