py5_tools.is_jvm_running()#

Determine if the Java Virtual Machine (JVM) is or is not running.

Examples#

1import py5_tools
2
3# this will be False
4py5.println(py5_tools.is_jvm_running())
5
6import py5
7
8# now it will be True
9py5.println(py5_tools.is_jvm_running())

Description#

Determine if the Java Virtual Machine (JVM) is or is not running. When the py5 library is imported it will start the JVM. Therefore this will be False before import py5 is executed and True afterwards. It should continue to always be True unless somewhere there is some Java code that calls System.exit(). Calling System.exit() is not recommended. If for some reason the JVM crashes (perhaps through a segmentation fault), the JVM will no longer be running, but that crash will most likely also terminate the Python interpreter.

Syntax#

is_jvm_running() -> bool

Updated on September 11, 2021 16:51:34pm UTC