Python learning twenty-second days file byte type

    All files are stored in binary form on the computer, but sometimes we need to convert the binary to GBK or UTF-8 form, encode and decode when encoding. Here is a brief description of the role of Python binary in the file transfer process.

1,pythonWhich formats are binary transmission?

Video, pictures, music

2,pythonFunction of file binary

In the process of network programming, in the process of network transmission, people do not want to see the encoding, can use binary transmission, fast, safe and reliable.

3,pythonBinary usage of files

rb,Binary read mode

wb,Binary write mode

ab,Binary write appending mode

The article comes from (http://www.96net.com.cn/).

Leave a Reply

Your email address will not be published. Required fields are marked *