I\'m working on an application that intersperses a bunch of jython and java code. Due to the nature of the program (using wsadmin) we are really restricted to Python 2.1
the following works for me :
import sys
import os
import java.lang.ClassLoader
import java.io.InputStreamReader
import java.io.BufferedReader
loader = java.lang.ClassLoader.getSystemClassLoader()
stream = loader.getResourceAsStream("com/example/action/myAction.py")
reader = java.io.BufferedReader(java.io.InputStreamReader(stream))
script = ""
line = reader.readLine()
while (line != None) :
script += line + "\n"
line = reader.readLine()
exec(script)