Bruno Desthuilliers enlightened us with:
> (Carl's top-post corrrected. Carl, please do not top-post)
If you correct people and ask them to alter their posting style, at
least make sure you post in a proper way. Snip what you're not
directly referring to, so people don't have to scroll in order to
Shi Mu a écrit :
> On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote:
>
(Carl's top-post corrrected. Carl, please do not top-post)
>>
>>
>>Ben Bush wrote:
>>
>>>I wrote the following code to test the use of "try...exception",
>>>and I want n to be printed out. However, the following code'
Shi Mu <[EMAIL PROTECTED]> wrote:
...
> If we do not know when the error will happen during the calculation
> but still want to continue till end, what should I do?
> for example:
>
> def test(a,b,c):
> return a/(b-c)
> q=[1,1,2,2,4,6,9,0]
> for i in range(len(q)):
> print test(q[i],q[i
On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote:
> Shi Mu wrote:
> > On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote:
> >
> >> I would think that when the exception occurs the interpreter exits the
> >> block of code it is currently in and enters the exception block.
> >>
> >>
Shi Mu wrote:
> On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote:
>
>> I would think that when the exception occurs the interpreter exits the
>> block of code it is currently in and enters the exception block.
>>
>> Thus the line n = 1/2 would never get executed.
>>
>>
>> -Carl
>>
>> B
On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote:
> I would think that when the exception occurs the interpreter exits the
> block of code it is currently in and enters the exception block.
>
> Thus the line n = 1/2 would never get executed.
>
>
> -Carl
>
> Ben Bush wrote:
> > I wrote the
I would think that when the exception occurs the interpreter exits the
block of code it is currently in and enters the exception block.
Thus the line n = 1/2 would never get executed.
-Carl
Ben Bush wrote:
> I wrote the following code to test the use of "try...exception",
> and I want n to be
I wrote the following code to test the use of "try...exception",
and I want n to be printed out. However, the following code's output is:
Traceback (most recent call last): File "C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in _