ryan.arana at gmail.com
Sat Mar 13 18:25:13 CET 2010
Why would you use line.__str__() instead of str(line) ?
Mostly because I'm a Python Noob, and dir(line) reminded me about its
__str__() method. And I did note that this wasn't the best way to do it,
just that it'd work. Now I know about str(line) though, so thanks!
On Fri, Mar 12, 2010 at 4:46 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Ryan Arana wrote:
> On second thought though, the easiest (read: the quickest, and
>> not necessarily the best) way to make this work (if print data4 works the
>> way I think it does anyway) would be to just change "line" to
>> "line.__str__()" in the line.replace line of code. So it will read
>> "line.__str__().replace('[', ' ').replace(']', ' ').
> Why would you use line.__str__() instead of str(line) ? For that matter,
> instead of using replace, the OP could do
> to chop off the beginning and ending brackets.
> Portland mailing list
> Portland at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Portland