|
From: J D <jam...@ho...> - 2001-09-24 21:45:58
|
Hi, perhaps you can help. As a python and jython newbie I am trying to embed some jython code into my java program. Seems an easy way to do this is by creating a PythonInterpreter object. So far, so good. My problem arises when I attempt a conditional statement such as: String erpFormula = ( "if ( 10 * math.log10( TransmitPower ) > 10 and LineLoss + RadomeLoss > 6 ): resultant = 20; else: resultant = 10" ); PythonInterpreter interp = new PythonInterpreter(); interp.exec( erpFormula ); The runtime error is: Syntax error: invalid syntax. Evidentally it chokes on the else keyword. If I remove the else..., it runs correctly. Any and all help you can provide is much appreciated, Jim. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |