Re: [Tutor] try except block for multiple statements

2008-12-07 Thread Kent Johnson
On Sun, Dec 7, 2008 at 12:25 PM, Lie Ryan <[EMAIL PROTECTED]> wrote: > texts = ["a = %s\n" % plan.a, > "b = %s\n" % plan.b, > "c = %s\n" % plan.c, > "d = %s\n" % plan.d >] > > for text in texts: >try: >fo.write(text) >except AttributeError: >

Re: [Tutor] try except block for multiple statements

2008-12-07 Thread Lie Ryan
On Mon, 01 Dec 2008 20:44:20 -0500, Bryan Fodness wrote: > I would like to use a try except to see if a value exists. But, when I > use the following, if a does not exist it exits. I understand why this > does this, but is there a way to get b,c, and d if a does not exist > without using a try e

Re: [Tutor] try except block for multiple statements

2008-12-01 Thread bob gailer
Bryan Fodness wrote: I would like to use a try except to see if a value exists. But, when I use the following, if a does not exist it exits. I understand why this does this, but is there a way to get b,c, and d if a does not exist without using a try except for every statement? try: fo

Re: [Tutor] try except block for multiple statements

2008-12-01 Thread John Fouhy
On 02/12/2008, Bryan Fodness <[EMAIL PROTECTED]> wrote: > I would like to use a try except to see if a value exists. But, when I use > the following, if a does not exist it exits. I understand why this does > this, but is there a way to get b,c, and d if a does not exist without using > a try exc

[Tutor] try except block for multiple statements

2008-12-01 Thread Bryan Fodness
I would like to use a try except to see if a value exists. But, when I use the following, if a does not exist it exits. I understand why this does this, but is there a way to get b,c, and d if a does not exist without using a try except for every statement? try: fo.write("a = %s\n" %plan.a)