xxxxxxxxxx
r Opens a file for reading only. (default)
w Opens a file for writing only, deleting earlier contents
a Opens a file for appending.
t opens file in text format (default)
b Opens a file in binary format.
+ Opens a file for simultaneous reading and writing.
x opens file for exclusive creation.