#之前一直没明白文件处理中的w和wb的区别到底是什么,
#在看过视频后才知道,原来在linux里面是没有区别的,
#但是在windows里面就能够看出区别来了
#下面来个例子:
with open("普通文本文件.txt", "w",encoding='utf-8') as f:
data = 'This is testing!\nThis is testing!'
f.write(data)
f.close()
with open("二进制文本文件.txt", "wb") as f:
data = b'This is testing!\nThis is testing!'
f.write(data)
f.close()