Related questions

0 votes
1 answer
0 votes
1 answer
asked Apr 15, 2017 in Python by anonymous
0 votes
0 answers
0 votes
1 answer
asked Sep 6, 2017 in Python by anonymous
0 votes
0 answers
asked Sep 6, 2017 in Python by anonymous

Explain all the file processing modes supported by Python ?

0 votes

Explain all the file processing modes supported by Python ?

asked Jun 5, 2017 in Python by anonymous

1 Answer

0 votes

Python allows you to open files in one of the three modes. They are:
read-only mode, write-only mode, read-write mode, and append mode by specifying the flags “r”, “w”, “rw”, “a” respectively.
A text file can be opened in any one of the above said modes by specifying the option “t” along with
“r”, “w”, “rw”, and “a”, so that the preceding modes become “rt”, “wt”, “rwt”, and “at”.A binary file can be opened in any one of the above said modes by specifying the option “b” along with “r”, “w”, “rw”, and “a” so that the preceding modes become “rb”, “wb”, “rwb”, “ab”.

answered Jun 5, 2017 by anonymous
...