<p dir="ltr">What about this then? For reading text files, use \r\n.  For reading outputs from GRASS modules and writing, use os.linesep.</p>
<p dir="ltr">I think this makes sense because it can handle cross platform files safely and it's very unlikely to have mixed newlines from modules compiled on the same platform. </p>
<p dir="ltr">Or simply just use \r\n for reading and os.linesep for writing? </p>
<p dir="ltr">-- <br>
Sent from my phone</p>
<div class="gmail_quote">On Apr 11, 2016 10:58 AM, "Martin Landa" <<a href="mailto:landa.martin@gmail.com">landa.martin@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Huidae,<br>
<br>
{I took liberty to move discussion to ML}<br>
<br>
2016-04-11 15:54 GMT+02:00 Huidae Cho <<a href="mailto:grass4u@gmail.com">grass4u@gmail.com</a>>:<br>
> That was a copy+paste from the same script, but I think \r\n is safer than<br>
> os.linesep just in case v.to.db prints out \r for whatever reason. But I<br>
> know that won't happen in non-Windows anyway, so os.linesep should be fine?<br>
<br>
hm, you are right, but still I would prefer to use os.linesep over<br>
'\r\n'. The only problem can happen when the user will ship generated<br>
files between Unix and Windows OS.<br>
<br>
Any comments from others?<br>
<br>
Thanks, Martin<br>
<br>
--<br>
Martin Landa<br>
<a href="http://geo.fsv.cvut.cz/gwiki/Landa" rel="noreferrer" target="_blank">http://geo.fsv.cvut.cz/gwiki/Landa</a><br>
<a href="http://gismentors.cz/mentors/landa" rel="noreferrer" target="_blank">http://gismentors.cz/mentors/landa</a><br>
</blockquote></div>