REPOST: Re: Paramaterized local variable name

Tim Cera timcera at
Sun Dec 30 09:34:52 EST 2001

Hans Nowak <wurmy at> wrote
> You probably want
>   start = getattr(data[key][i], local_name)
> Now you can set local_name to a string "name" or "rev"
> or whatever attribute of data[key][i] you want to
> access.

Works great!


Thanks also to Sean for the 'exec' based solution.

take care
Tim Cera

========= WAS CANCELLED BY =======:
From: timcera at (Tim Cera)
Newsgroups: comp.lang.python
Subject: cmsg cancel <9c3f2e9c.0112300634.6e2c1ef6 at>
Control: cancel <9c3f2e9c.0112300634.6e2c1ef6 at>
Date: Mon, 31 Dec 2001 03:05:55 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.9c3f2e9c.0112300634.6e2c1ef6 at>
X-Trace: 1009774221 27193 (31 Dec 2001 04:50:21 GMT)
X-Complaints-To: usenet at
NNTP-Posting-Date: Mon, 31 Dec 2001 04:50:21 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.

More information about the Python-list mailing list