file handling modes in python

Solutions on MaxInterview for file handling modes in python by the best coders in the world

showing results for - "file handling modes in python"
Cameron
22 Aug 2017
1Mode:   Description:
2"r"		# Opens a file for reading. (default)
3"w"		# Opens a file for writing. Creates a new file if it does not exist or truncates the file if it exists.
4"x"		# Opens a file for exclusive creation. If the file already exists, the operation fails.
5"a"		# Opens a file for appending at the end of the file without truncating it. Creates a new file if it does not exist.
6"t"		# Opens in text mode. (default)
7"b"		# Opens in binary mode.
8"+"		# Opens a file for updating (reading and writing)