Get attribute this way

Chris Rebert clp2 at rebertia.com
Tue Nov 17 02:21:46 EST 2009


On Mon, Nov 16, 2009 at 10:53 PM, King <animator333 at gmail.com> wrote:
> Writing/Reading data to xml is not a problem. The problem is when I
> have to write to attributes in xml, where a connections has been
> established.
> XML:
> <Connection sourceattribute="node1.gradient.colors[0][1]"
> destattribute="node2.gradient.colors[1][2]"/>

You did not include an example like this in your original post.

I'd say you're stuck using eval() unless you want to change your
format or write a parser for the subset of Python involved.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list