<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
My limited repertoire. Actually, there wasn't much of a traceback. It
came up in a small OK dialog. I copied what I could.&nbsp; I see my image I
used above did make it to the list, so here's the skinny.<br>
<img src="cid:part1.09020003.09060706@sbcglobal.net" alt=""><br>
<br>
I see Marc covered it with setattr. How does one do it with a
dictionary? What else lurks out there that might be useful along these
lines?<br>
<br>
Alan Gauld wrote:
<blockquote cite="mid:gnch9l$tdn$1@ger.gmane.org" type="cite">"Wayne
Watson" <a class="moz-txt-link-rfc2396E" href="mailto:sierra_mtnview@sbcglobal.net">&lt;sierra_mtnview@sbcglobal.net&gt;</a> wrote <br>
  <blockquote type="cite">Python doesn't like the code in the Subject
(unqualified exec not allowed in function). but easily likes
self.abc="22". </blockquote>
  <br>
We'd need to see the code and traceback to guess why...
  <br>
  <br>
  <blockquote type="cite">However, I'd like to assemble the assignment
as a string, as shown in Subject, and execute it. Is there a way to do
this?
    <br>
  </blockquote>
  <br>
exec is the usual way but it's also usually a bad idea.
  <br>
  <br>
Any reason why you want to do that rather than any of the safer
alternatives? (dict, setattr etc)
  <br>
  <br>
  <br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html;" http-equiv="Content-Type">
<title>Signature.html</title>
<pre class="moz-signature" cols="76">           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
<font color="#330099">            </font>
<span style="font-weight: bold;">            <span
 style="color: rgb(255, 153, 255);">Shhhh, quiet. I'm thinking about filling this space.</span></span><b><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="color: rgb(255, 153, 255);"> </span><span
 style="font-family: monospace;"></span></b></b>

</pre>
<div style="margin-left: 40px;">
<b><b style="color: rgb(204, 51, 204);" class="b"><span
 style="font-family: monospace;"></span></b></b></div>
<pre class="moz-signature" cols="76"><b><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="font-family: monospace; color: rgb(153, 51, 153);"></span></b></b><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="font-family: monospace; color: rgb(153, 51, 153);"></span></b><span
 style="color: rgb(153, 51, 153);"></span><span
 style="color: rgb(153, 51, 153);">
</span><span style="color: rgb(153, 51, 153);"></span><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="font-family: monospace;"></span></b><span
 style="color: rgb(204, 51, 204);"></span>                    Web Page: &lt;<a class="moz-txt-link-abbreviated" href="http://www.speckledwithstars.net/">www.speckledwithstars.net/</a>&gt;</pre>
</div>
</body>
</html>