Chapter 9, Common Functions and Methods in Python (9.5-9.6)------open function open(), write write(), writelines(), read read(), readlines(), readline()

Table of contents
9.5 python open function open() and text file and binary file
(1) text file and binary file
(2) parameter file (3
) parameter mode
(4) parameter buffering
(5) parameter encoding
(6) parameter errors
(7) ) parameter newline
(8) parameter closefd
(9) parameter opener
(10) open() return value
9.6 python write write(), writelines() and read read(), readlines(), readline()

9.5 Python's open function open() and text files and binary files

(1) Text files and binary files

       Generally speaking, computer files can be divided into two categories: text files and binary files. Files are stored physically in the computer in binary form. From the perspective of physical storage, there is no distinction between text files and binary files. The distinction between text files and binary files is based on the encoding level, which is a distinction between data representations and a logical relationship.

     

Guess you like

Origin blog.csdn.net/thefg/article/details/127987573