文件b处理模式
# fb = open('tes11.py', 'rb', encoding='utf-8') # b方式不能指定编码
# fb = open('tes111.py', 'rb') # b方式不能指定编码
# data = fb.read()
# '字符串'--encode--》bytes
# bytes -----decode--->'字符串' 将二进制转换成utf-8
# print(data.decode('utf-8'))
f = open('tes22.py', 'ab') # 追加,就是添加到文件后面
# f.write(bytes('111222\n', encoding='utf-8'))
f.write('等滴滴'.encode('utf-8'))