Jython, komut satiri giris parametreleri, modul ekleme
PySystemState pySystemState = new PySystemState();
pySystemState.path.append(Py.newString("python/"));
pySystemState.path.append(Py.newString("python/"));
//Burada python dizini altindaki moduller sisteme tanimli hale geitiriliyor
pySystemState.argv.append(Py.newString(pathToInFile+urlId));
pySystemState.argv.append(Py.newString(pathToInFile+urlId));
//Dikkat argv[0] bos o nedenle argv[1] den basla
Py.setSystemState(pySystemState);
PythonInterpreter python = new PythonInterpreter();
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
python.setOut(outStream);
python.execfile("python/Expedia.py");
String text = outStream.toString();
Py.setSystemState(pySystemState);
PythonInterpreter python = new PythonInterpreter();
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
python.setOut(outStream);
python.execfile("python/Expedia.py");
String text = outStream.toString();
Toplam 0 Yorum:
Yorum Gönder
<< Ana Sayfa