Python - Julia 变量传输
假设我有一个包含 python 和 julia 的 jupyter 笔记本。在 julia 中我有一个变量
var_julia = 10
,在 python 中我有
var_python = 20
我想做的是有效地(没有任何 JSON 或 CSV)在这两个变量之间传输,这样我就可以在 python 中打印 var_julia 并在 julia 中打印 var_python 。我该怎么做呢?
Let's say I have a jupyter notebook with both python and julia. In julia i have a variable
var_julia = 10
and in python I have
var_python = 20
What I would like to do is to efficiently (without any JSONs nor CSVs) transfer these 2 variables between, so I can print var_julia in python and var_python in julia. How should I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基本上使用前面提到的 PyCall PyJulia 你可以这样做:
反之亦然:
Basically using the forementioned PyCall PyJulia you can do:
and for the other way round:
查看 PythonCall 和 JuliaCall ,它应该涵盖您的用例。
还有用于“从 Julia 调用 Python”方向的 PyCall.jl 和 PyJulia 用于“从 Python 调用 Julia”方向。
Have a look at PythonCall and JuliaCall which should cover your use case.
There's also PyCall.jl for the "call Python from Julia" direction and PyJulia for the "call Julia from Python" direction.