<div class="gmail_quote">On Fri, Sep 21, 2012 at 11:11 AM, Dae James <span dir="ltr"><<a href="mailto:daedae11@126.com" target="_blank">daedae11@126.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<u></u>





<div style="MARGIN:10px">
<div>How can I convert a variable name to a string ? </div>
<div>For example:</div>
<div>testVariable = 1000;</div>
<div>How can I get the string "testVariable" ?</div>
<div>Thank you~</div>
<div><br></div></div></blockquote><div><br></div><div>Well, the locals() dictionary will have a "testVariable" entry in it.. but if I may ask, why would you want to do this? I see no reason this would ever be necessary.</div>

<div><br></div><div>Hugo</div></div>