Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is JuliaLang's equivalent to Python's sys.executable?

Tags:

julia

I would like to retrieve the path of the currently running Julia interpreter from Julia. In Python, this can be achieved with sys.executable.

like image 633
Quant Avatar asked Dec 29 '25 05:12

Quant


1 Answers

Base.julia_cmd() is probably what you need. It returns the full command line that was used to invoke the current julia process, with the default options spelled out. Base.julia_exename() returns the name of the executable.

julia> Base.julia_cmd()

/Users/aviks/dev/julia/julia5/usr/bin/julia -Cnative -J/usr/lib/julia/sys.dylib --compile=yes --depwarn=yes

julia> Base.julia_exename()
"julia"
like image 52
aviks Avatar answered Dec 30 '25 23:12

aviks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!