Problem with JPython!

Remco Gerlich scarblac-spamtrap at pino.selwerd.nl
Wed Aug 30 13:25:01 EDT 2000


ARG3000 wrote in comp.lang.python:
> Running the following string
> 	"\nif 1.0 > 2.0:\n\tprint 1.0\nelse:\n\tprint 2.0\n"
>  using 
> 	org.python.util.PythonInterpreter
> 
> exec I get result '2.0' printed to stdout.  this is what I would expect
> 
> Running the same string through eval it bombs.
> Is there anything I should be aware of that i'm doing wrong?

Eval takes expressions. 'if' is a command, just like 'print', so that
string isn't an expression.

-- 
Remco Gerlich,  scarblac at pino.selwerd.nl
Hi! I'm a .sig virus! Join the fun and copy me into yours!



More information about the Python-list mailing list