In the following code I simply execute test.py from java code using jython
public static void main(String[] args) {
org.python.util.PythonInterpreter python = new org.python.util.PythonInterpreter();
python.execfile("test.py");
...
My problem is test.py needs to be in same directory from where jar file is run.
I need this test.py bundled inside the jar and still be able to execute it using jython.
Approach suggested in How do you invoke a python script inside a jar file using python? to read the script in string using getResourceAsStream method from ClassLoader class wont work for me as my test.py imports more python scripts all bundled inside the jar.
Being new to java and jython i'm really confused.
Any help will be highly appreciated..!