I have a python module auth.py:
keys= {
"s1": ["k1", "k2"],
"s2": ["k1", "k2"]
}
def get_keys_by_name(name):
return keys[name]
And the calling Java code:
String keyname= "somename"
interpreter.exec("from services.framework import auth");
List<String> keys = (List<String>) interpreter
.eval("auth.get_keys_by_name(" + keyname+ ")");
Each time i call the code i get a NameError form the argument (keyname) that i try to pass to the python code.
Anyone knows what i am doing wrong?
getKeysByName("abc")while your code looks more likegetKeysByName(abc).