\r\n or \n notepad editor end line ???
Fredrik Lundh
fredrik at pythonware.com
Mon Jun 13 05:53:25 EDT 2005
<ajikoe at gmail.com> wrote:
> It means in windows we should use 'wb' to write and 'rb' to read ?
> Am I right?
no.
you should use "wb" to write *binary* files, and "rb" to read *binary*
files.
if you're working with *text* files (that is, files that contain lines of text
separated by line separators), you should use "w" and "r" instead, and
treat a single "\n" as the line separator.
</F>
More information about the Python-list
mailing list