From: Moshe Z. <mo...@us...> - 2001-03-23 18:09:49
|
Update of /cvsroot/py-howto/pyhowto In directory usw-pr-cvs1:/tmp/cvs-serv12387 Modified Files: doanddont.tex Log Message: Clarified except: example. Thanks, Shaleh and Jerji Index: doanddont.tex =================================================================== RCS file: /cvsroot/py-howto/pyhowto/doanddont.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** doanddont.tex 2001/03/20 21:13:18 1.1 --- doanddont.tex 2001/03/23 18:09:40 1.2 *************** *** 120,123 **** --- 120,132 ---- this has nothing to do with the readability of \code{"file"}. + The example above is better written + + \begin{verbatim} + try: + foo = opne("file") # will be changed to "open" as soon as we run it + except IOError: + sys.exit("could not open file") + \end{verbatim} + There are some situations in which the \code{except:} clause is useful: for example, in a framework when running callbacks, it is good not to |