What is the difference between rb and r+b modes in file objects

前端 未结 4 1224
借酒劲吻你
借酒劲吻你 2020-12-04 14:27

I am using pickle module in Python and trying different file IO modes:

# works on windows.. \"rb\"
with open(pickle_f, \'rb\') as fhand:
        obj = pickle         


        
4条回答
  •  情歌与酒
    2020-12-04 15:09

    r+ is used for reading, and writing mode. b is for binary. r+b mode is open the binary file in read or write mode.
    You can read more here.

提交回复
热议问题