On Wed, Feb 27, 2013 at 2:27 PM, Dave Angel <da...@davea.name> wrote:
> But to convert a DOS text file (with lines ending cr/lf) into a Unix text
> file (with lines ending lf)  would be a dozen lines, shrinkable to 3 with
> lots of experience.  (And I'd probably prefer the dozen line version)

Code golf!

open("outfile","wb").write(open("infile","rb").read().replace("\r",""))

No particular reason, and I'd probably prefer a 3-6 line version of
it, but it's fun to do it as one :)

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to