On Mon, 28 Jun 2010 06:04:31 pm Adam Bark wrote:
> I'm sure this "work it out yourself" answer is much more helpful.
Unfortunately, the only correct answer is that there is no One True
Answer.
A bit like life, really.
--
Steven D'Aprano
___
Tutor ma
On 28 June 2010 00:27, Steven D'Aprano wrote:
> On Mon, 28 Jun 2010 03:12:39 am Adam Bark wrote:
>
> > I think the 'as' syntax is only available in Python 3.x
>
> You think wrong. It is available from Python 2.6 onwards.
>
I know, I corrected myself after Steve Willoughby pointed it out.
>
>
>
On Mon, 28 Jun 2010 03:12:39 am Adam Bark wrote:
> I think the 'as' syntax is only available in Python 3.x
You think wrong. It is available from Python 2.6 onwards.
> Question marks go at the end of the sentence where you would normally
> put a full stop if it wasn't a question.
That's a terri
On 27 June 2010 18:22, Steve Willoughby wrote:
> On 27-Jun-10 10:12, Adam Bark wrote:
>
>> On 27 June 2010 17:47, Payal >
>
> c. What is the correct Python of writing,
>>except as e: print 'Msg : ' , e# Capturing all exceptions
>>
>
> Since exceptions are (should be?) subclasses
On 27-Jun-10 10:12, Adam Bark wrote:
On 27 June 2010 17:47, Payal
c. What is the correct Python of writing,
except as e: print 'Msg : ' , e# Capturing all exceptions
Since exceptions are (should be?) subclasses of Exception, you can do:
except Exception as e:
I think the
On 27 June 2010 17:47, Payal wrote:
> Hi,
> Again a few queries regarding exceptions,
>
> a. What is the difference between,
>
> except ZeroDivisionError as e: print 'Msg : ' , e
> except ZeroDivisionError ,e: print 'Msg : ' , e
>
> Both show,
> Msg : integer division or modulo by zero
>
> b. Wh
Hi,
Again a few queries regarding exceptions,
a. What is the difference between,
except ZeroDivisionError as e: print 'Msg : ' , e
except ZeroDivisionError ,e: print 'Msg : ' , e
Both show,
Msg : integer division or modulo by zero
b. What is portable and correct way of writing,
except (NameEr