On Sat, 11 Sep 2010 04:47:13 am Michael Powe wrote:
> No problem, I am working on getting this sorted out. The
> documentation seems to be written as reminder for people who already
> know how this stuff works, rather than as a clear explanation for
> anybody working with it.
That's because the
On Fri, Sep 10, 2010 at 04:42:35PM +0200, Peter Otten wrote:
> Michael Powe wrote:
> > On Fri, Sep 10, 2010 at 03:56:51PM +0200, Peter Otten wrote:
> >> Michael Powe wrote:
> >> > I can't work out how to suppress stacktrace printing when exceptions
> >> > are thrown.
> >> WRONG:
> >>
> >> >>>
Michael Powe wrote:
> On Fri, Sep 10, 2010 at 03:56:51PM +0200, Peter Otten wrote:
>> Michael Powe wrote:
>>
>> > I can't work out how to suppress stacktrace printing when exceptions
>> > are thrown.
>>
>> [snip rant]
>>
>> It might have been a good idea to read a tutorial like
>>
>> http://do
On Fri, Sep 10, 2010 at 03:50:57PM +0200, Evert Rol wrote:
> This is a bit of a guess, but as far as I know, you can catch exceptions like
> that.
> Try:
> try:
> data = opener.open(url)
> except urllib2.URLError as msg:
> print msg
> sys.exit(1)
> If you're using an older versio
>>> I can't work out how to suppress stacktrace printing when exceptions
>>> are thrown.
>>
>> [snip rant]
>>
>> It might have been a good idea to read a tutorial like
>>
>> http://docs.python.org/tutorial/errors.html#handling-exceptions
>
>> or ask before you got annoyed enough to write that r
On Fri, Sep 10, 2010 at 03:56:51PM +0200, Peter Otten wrote:
> Michael Powe wrote:
>
> > I can't work out how to suppress stacktrace printing when exceptions
> > are thrown.
>
> [snip rant]
>
> It might have been a good idea to read a tutorial like
>
> http://docs.python.org/tutorial/errors.htm
Michael Powe wrote:
> I can't work out how to suppress stacktrace printing when exceptions
> are thrown.
[snip rant]
It might have been a good idea to read a tutorial like
http://docs.python.org/tutorial/errors.html#handling-exceptions
or ask before you got annoyed enough to write that rant ;)
> I can't work out how to suppress stacktrace printing when exceptions
> are thrown.
>
> I want the thrown exception to pass a message on the console, just
> like Java does when I catch an exception and print e.getMessage().
>
> I tried some of the examples of controlling traceback through the
>
Hello,
I can't work out how to suppress stacktrace printing when exceptions
are thrown.
I want the thrown exception to pass a message on the console, just
like Java does when I catch an exception and print e.getMessage().
I tried some of the examples of controlling traceback through the
tracebac