Add in method to ScriptRunner to also get a variable result from the interpreter.

Change-Id: Ib14d48992b66371a6702a7dac621bf3a62d1a936
diff --git a/tools/monkeyrunner/src/com/android/monkeyrunner/ScriptRunner.java b/tools/monkeyrunner/src/com/android/monkeyrunner/ScriptRunner.java
index 2c145e6..c027be8 100644
--- a/tools/monkeyrunner/src/com/android/monkeyrunner/ScriptRunner.java
+++ b/tools/monkeyrunner/src/com/android/monkeyrunner/ScriptRunner.java
@@ -73,6 +73,13 @@
         python.exec(script);
     }
 
+    public static PyObject runStringAndGet(String script, String name) {
+        initPython();
+        PythonInterpreter python = new PythonInterpreter();
+        python.exec(script);
+        return python.get(name);
+    }
+
     private static void initPython() {
         List<String> arg = Collections.emptyList();
         initPython(arg, new String[] {""});