Message12730

Author rkanumola
Recipients rkanumola
Date 2019-10-30.07:44:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572421461.73.0.99641486916.issue2818@roundup.psfhosted.org>
In-reply-to
Content
Please ignore the previous sample. Take the following one for reference:
 try {
            Properties properties = new Properties();
            properties.setProperty("python.home", "../jython2.7.1/");
            properties.setProperty("python.path", "../jython2.7.1/Lib");
            properties.setProperty("python.import.site", "false");
            PythonInterpreter.initialize(System.getProperties(), properties, new String[] {""});
            PythonInterpreter python = new PythonInterpreter();
            String script = "import sys\n" + "sys.path.append(\"../jython2.7.1/Lib\")\n" + "\n" + "import redis\n"
                    + "r = redis.Redis(host='localhost', port=6379)\n" + "r.get('foo')";
            python.set("script", new PyString(script));
            python.exec(script);
            python.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
History
Date User Action Args
2019-10-30 07:44:21rkanumolasetmessageid: <1572421461.73.0.99641486916.issue2818@roundup.psfhosted.org>
2019-10-30 07:44:21rkanumolasetrecipients: + rkanumola
2019-10-30 07:44:21rkanumolalinkissue2818 messages
2019-10-30 07:44:21rkanumolacreate