Jython, getting instance name from the interpreter
tommys
bob_tommy at hotmail.com
Mon Apr 28 19:23:28 EDT 2003
Does anyone know to get the instance names from the interpreter?
I want the getMyName method to return "instance" in this case, or a
list of names if many...
Thanks for any help!!
Tommy
public class InterPreter() {
private static PythonInterpreter interp = new PythonInterpreter();
private static String myscript = "instance = MyClass()";
public InterPreter() {interp.exec(myscript);}
public static String getInstanceName(Myclass mycl) {
//hmm, how to do this?
}
}
public class MyClass() {
public String getMyName() {
return InterPreter.getInstanceName(this);
}
More information about the Python-list
mailing list