On 2008-11-07 11:48, [EMAIL PROTECTED] wrote:
> On Nov 7, 11:20 am, Steven D'Aprano <[EMAIL PROTECTED]
> cybersource.com.au> wrote:
>
>>> What I am trying to do is to execute it "step-by-step", so that I can
>>> capture the exception if one line (or multi-line statement) fails, print
>>> a warning
On Nov 7, 11:20 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> > What I am trying to do is to execute it "step-by-step", so that I can
> > capture the exception if one line (or multi-line statement) fails, print
> > a warning about the failure, and continue the execution fo th
On Nov 6, 9:53 pm, Aaron Brady <[EMAIL PROTECTED]> wrote:
> Check out the InteractiveConsole and InteractiveInterpreter classes.
> Derive a subclass and override the 'push' method. It's not documented
> so you'll have to examine the source to find out exactly when and what
> to override.
Thanks,
On Thu, 06 Nov 2008 03:27:53 -0800, gregory.lielens wrote:
> Hi,
>
> I am using a small python file as an input file (defining constants,
> parameters, input data, ...) for a python application. The input file is
> simply read by an exec statement in a specific dictionary, and then the
> applicat
trol over the input file generation ? If the input file
> > can be easily divided into self sufficient blocks of code, you could
> > read each block in one at a time and do a compile() and exec(). Your
> > input file need not be a full python script too, you could just have
>
do a compile() and exec(). Your
> input file need not be a full python script too, you could just have
> token delimited blocks of python code which are read in 1 block at a
> time and then exec().
>
> -srp
>
>
>
> > Is there a better way for a step-by-step exec? Synta
ficient blocks of code, you could
read each block in one at a time and do a compile() and exec(). Your
input file need not be a full python script too, you could just have
token delimited blocks of python code which are read in 1 block at a
time and then exec().
-srp
>
> Is there a better w
flow like if - else
statements or loops.
Is there a better way for a step-by-step exec? Syntax errors in the
input script are not really a problem (as it is generated elsewhere,
it is not directly edited by users), although it would be nice to
catch. The biggest problem are runtime errors (attribut