Re: execution error

2005-05-24 Thread Ximo
>>Ximo> My question is how can show the execution error whitout exit of >> the program, showing it in the error output as >> Skip> You need to catch ZeroDivisionError. Here's a trivial example: >>>>> try: >>... 6/0 >>... except ZeroDivisionError: >>... print "whoops!

Re: execution error

2005-05-24 Thread Ximo
"Skip Montanaro" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > >Ximo> And my question is how can show the execution error whitout exit >Ximo> of the program, showing it in the error output as > > You need to catch ZeroDivisionError. Here's a trivial example: > >

Re: execution error

2005-05-23 Thread Paul McNett
Ximo wrote: > Hello, I'm programing an advanced calculator, and I have many problems with > the execution errors, specually with the division by 0. > > And my question is how can show the execution error whitout exit of the > program, showing it in the error output as Wrap the math in a try/ex

Re: execution error

2005-05-23 Thread Skip Montanaro
Ximo> And my question is how can show the execution error whitout exit Ximo> of the program, showing it in the error output as You need to catch ZeroDivisionError. Here's a trivial example: >>> try: ... 6/0 ... except ZeroDivisionError: ... print "whoops! divide by z

Re: execution error

2005-05-23 Thread Paul Rubin
"Ximo" <[EMAIL PROTECTED]> writes: > And my question is how can show the execution error whitout exit of the > program, showing it in the error output as... > >>6/0 > >>"Error: Division per 0" Trap the ArithmeticError exception and go by the name of the exception class. See the language ref manu