Open schlichtanders opened 3 weeks ago
There is no API for this. The only way I can think of is to first check if PythonCall
is in Base.loaded_modules
(or just import PythonCall
) then check PythonCall.C.CTX.is_embedded
which is true
if you are in JuliaCall.
(This is relying on internals of both Base
and PythonCall
.)
Oh another way is to do exactly what PythonCall
itself does: hasproperty(Base.Main, :__PythonCall_libptr)
is true if you are in JuliaCall.
Again, this relies on internals.
thank you very much. Great that at least there is way which kind of works. I guess it is fine for me to rely on internals for now.
motivation: build juliacode which has some specific behaviour when run via JuliaCall reusing the same code simplifies the interface as well as the code size