[Tutor] Terminology question

Alan Gauld alan.gauld at btinternet.com
Sat May 16 19:12:52 CEST 2015


On 16/05/15 17:56, Jim Mooney Py3.4.3winXP wrote:

> I can see I was marvelously unclear ;') Here is what I meant.
>
> def make_error():
>      raise ZeroDivisionError('Here I am')
>
> def call_error():
>      try:
>          make_error()
>      except:
>          print("How do I get the 'Here I am' message to print in the calling
> routine?")
>
>
>>>> call_error()
> How do I get the 'Here I am' message to print in the calling routine?

And the remainder of Steven's reply showed you how, using the
args attribute of the error.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list