Hi,
I'm trying to extend InteractiveInterpreter but I have some problems
with encoding. For example,
if I compile the following test class:
public class Test {
public static void main(String[] args) {
System.out.println("Test: á");
PythonInterpreter interp = new PythonInterpreter();
interp.exec("print 'á'");
}
The second printed line shows a wrong character for 'á', but the Jython
interactive console prints
the right char. I think maybe it is due to Readers using the platform
enconding (UTF-8 in my case)
and InputStreams using the Java default encoding (UTF-16?).
Any suggestions?
Thanks.

I am trying to run the following script.
# Python Modules
import java
import org
def xyz(cmd, mode='r'):
runtime = java.lang.Runtime.getRuntime()
process = runtime.exec(cmd)
return
org.python.core.PyFile(process.getInputStream(),
process.getOutputStream(), mode)
When I call it via the command line it works file.
When I call it from an embedded interperter I
get the following error.
AttibuteError: java package 'org' has no attribute
'python'
I have checked the sys.path and they are not identical
but both do contain the same paths.
Other scripts that do not import java classes work fine.
Any suggestions?
Thanks