Steven D'Aprano <[EMAIL PROTECTED]> writes:
> Would it be less crufty if I wrote it as a cryptic one liner without
> comments?
> 
> f.write(str(data)[1:-1].replace(',', '') + '\n')

That doesn't look terribly cryptic to me, but maybe I'm used to it.

> > Try this: f.write(' '.join(str(x) for x in data) + '\n')
> That will only work in Python 2.5 or better.

It should work in 2.4, I think.  Though, I haven't tried 2.5 yet so I
can't say from experience whether 2.4 is better than 2.5.  Anyway,

  f.write(' '.join(map(str, data)) + '\n')

should work in the whole 2.x series, if I'm not mistaken.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to