title: Bundling python files inside jar for access via jython
body: <p>In the following code I simply execute test.py from java code using jython</p>
  
  <pre><code>public static void main(String[] args) {
    org.python.util.PythonInterpreter python = new org.python.util.PythonInterpreter();
    python.execfile("test.py");
    ...
  </code></pre>
  
  <p>My problem is test.py needs to be in same directory from where jar file is run.<br>
  I need this test.py bundled inside the jar and still be able to execute it using jython.  </p>
  
  <p>Approach suggested in <a href="https://stackoverflow.com/questions/2551269/how-do-you-invoke-a-python-script-inside-a-jar-file-using-python">How do you invoke a python script inside a jar file using python?</a> 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. </p>
  
  <p>Being new to java and jython i'm really confused.<br>
  Any help will be highly appreciated..!</p>