I am using Python to execute the JVM for a specified Java class, like so:
import subprocess
output = subprocess.check_output("java MyJavaClass")
However, the Java class is not in the same directory as the Python script, so this does not work. It is in a bin directory two directories up.
So I was hoping it would be possible to do something like below, but it doesn't work:
output = subprocess.check_output("java ../../bin/MyJavaClass")
Any ideas?
os.getcwd()