Message12192
Also, what version of Jython are you on?
jython-standalone-2.7.1
Python class :
#!/router/bin/python
from trexImp import TrexClient
class testAdd(TrexClient):
def func1 (self,**kwargs):
print(kwargs)
Java code :
Interface :
import java.util.Map;
public interface TrexClient{
public void func1(Map<String,String> kwargs);
}
Class :
import org.python.core.*;
import org.python.util.PythonInterpreter;
import java.util.HashMap;
import java.util.Map;
public class TrexClientFactory {
public TrexClientFactory() {
PythonInterpreter interpreter = new PythonInterpreter();
interpreter.exec("import sys");
interpreter.exec("sys.path.append('/Users/mohamad.mahajna/IdeaProjects/new_stepsNG/aa/src/main/javatrex_stf_lib1')");
interpreter.exec("from testAdd import *");
PyObject trexClientClass = interpreter.get("testAdd");
PyObject buildingObject = trexClientClass.__call__();
TrexClient x = (TrexClient) buildingObject.__tojava__(TrexClient.class);
Map<String,String> kwargs = new HashMap<>();
kwargs.put("cfg","abcf");
x.func1(kwargs);
}
}
Exception in thread "main" TypeError: func1() takes exactly 1 argument (2 given) |
|
Date |
User |
Action |
Args |
2018-12-02 11:01:11 | mohamad.mahajna | set | messageid: <1543748471.19.0.788709270274.issue2717@psf.upfronthosting.co.za> |
2018-12-02 11:01:11 | mohamad.mahajna | set | recipients:
+ mohamad.mahajna, jeff.allen |
2018-12-02 11:01:11 | mohamad.mahajna | link | issue2717 messages |
2018-12-02 11:01:10 | mohamad.mahajna | create | |
|