从Python脚本获取Julia版本
我正在尝试从Python脚本中获取Julia版本。
C:\Users> julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.0.3 (2018-12-18)
_/ |\__'_|_|_|\__'_| |
|__/ |
julia> VERSION
v"1.0.3"
julia> exit()
C:\Users>
这就是我在CMD中这样做的方式。
寻找一种使用Python访问此版本值的方法。
当使用OS.System('Julia')
时,它永远不会退出此阶段,因为我想它正在等待此朱莉娅环境中的命令。
I'm trying to get the Julia version from a python script.
C:\Users> julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.0.3 (2018-12-18)
_/ |\__'_|_|_|\__'_| |
|__/ |
julia> VERSION
v"1.0.3"
julia> exit()
C:\Users>
This is the way I do it in CMD.
Looking for a way to access this version value using python.
When using os.system('julia')
it never exits this stage because I guess it is waiting for a command within this Julia environment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用Julia解释器的 command-noreferrer“> command-line”选项 shell中的代码> -v :
此系统命令也可以使用eg
subprocess
从python中调用,请参见运行shell命令并捕获输出
You can use the julia interpreter's command-line option
-v
in the shell:This system command can also be invoked from within Python using e.g.
subprocess
:See Running shell command and capturing the output