|
From: Jim A. <ji...@tr...> - 2001-06-27 13:45:51
|
Rajesh Vilasrao Bhujbal wrote: > > Hi, > In my project i want to call jython script file (.py) in java > programme. I dont' want to compile jython script file, because i want > to cange some things in script file. I want avoid recompiling of java > file. > > So can you help me in this matter. Please send me code to call .py > file through java. > > Rajesh > Snippet below from Bruce Eckel's 'Thinking in Patterns' with Java, Chapter 9. Download the book here: http://www.mindview.net/Books/TIPatterns/ %<----------- PythonInterpreter interp = new PythonInterpreter(); System.out.println( "Loading GreenHouse Language"); interp.execfile("GreenHouseLanguage.py"); System.out.println("Loading GreenHouse Script"); interp.execfile("Schedule.ghs"); System.out.println("Executing GreenHouse Script"); interp.exec("run()"); %<----------- -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' "There are many ways of moving forward, but only one way of standing still." - Franklin D. Roosevelt |