[snip]<div>Why would you use line.__str__() instead of str(line) ?</div><div>[/snip]</div><div><br></div><div>Mostly because I&#39;m a Python Noob, and dir(line) reminded me about its __str__() method. And I did note that this wasn&#39;t the best way to do it, just that it&#39;d work. Now I know about str(line) though, so thanks!<br>
<br><div class="gmail_quote">On Fri, Mar 12, 2010 at 4:46 PM, Ethan Furman <span dir="ltr">&lt;<a href="mailto:ethan@stoneleaf.us">ethan@stoneleaf.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Ryan Arana wrote:<br>
<br>
[snip]<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On second thought though, the easiest (read: the quickest, and<br>
not necessarily the best) way to make this work (if print data4 works the<br>
way I think it does anyway) would be to just change &quot;line&quot; to<br>
&quot;line.__str__()&quot; in the line.replace line of code. So it will read<br>
&quot;line.__str__().replace(&#39;[&#39;, &#39; &#39;).replace(&#39;]&#39;, &#39; &#39;).<br>
</blockquote>
<br></div>
Why would you use line.__str__() instead of str(line) ?  For that matter, instead of using replace, the OP could do<br>
<br>
    str(line)[1:-1]<br>
<br>
to chop off the beginning and ending brackets.<br><font color="#888888">
<br>
~Ethan~</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Portland mailing list<br>
<a href="mailto:Portland@python.org" target="_blank">Portland@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/portland" target="_blank">http://mail.python.org/mailman/listinfo/portland</a><br>
</div></div></blockquote></div><br></div>