Adding error check on python demo 1 that script is called from correct demos/python directory

This commit is contained in:
jlizier 2018-06-27 20:49:32 +10:00
parent 8c5aa51f57
commit a278060056
1 changed files with 5 additions and 2 deletions

View File

@ -23,9 +23,12 @@
import jpype
import random
import numpy
import os
# Change location of jar to match yours:
jarLocation = "../../infodynamics.jar"
# Change location of jar to match yours (we assume script is called from demos/python):
jarLocation = os.path.join(os.getcwd(), "..", "..", "infodynamics.jar");
if (not(os.path.isfile(jarLocation))):
exit("infodynamics.jar not found (expected at " + os.path.abspath(jarLocation) + ") - are you running from demos/python?")
# Start the JVM (add the "-Xmx" option with say 1024M if you get crashes due to not enough memory space)
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea", "-Djava.class.path=" + jarLocation)