R
rbt
I believe that this is the safest way to open files on Windows, Linux,
Mac and Unix, but I wanted to ask here just to be sure:
fp = file('filename', 'rb')
The 'b' on the end being the most important ingredient (especially on
Windows as a simple 'r' on a binary file might cause some sort of
corruption).
Anyway, am I right in saying this? That 'rb' is the safest way to open
files for reading and that it should work well on *all* Python supported
platforms?
Many thanks,
RBT
Mac and Unix, but I wanted to ask here just to be sure:
fp = file('filename', 'rb')
The 'b' on the end being the most important ingredient (especially on
Windows as a simple 'r' on a binary file might cause some sort of
corruption).
Anyway, am I right in saying this? That 'rb' is the safest way to open
files for reading and that it should work well on *all* Python supported
platforms?
Many thanks,
RBT