t指文本模式。
r和
rt和
w和与之间没有区别,
wt因为默认为文本模式。
记录在这里:
Character Meaning'r' open for reading (default)'w' open for writing, truncating the file first'x' open for exclusive creation, failing if the file already exists'a' open for writing, appending to the end of the file if it exists'b' binary mode't' text mode (default)'+' open a disk file for updating (reading and writing)'U' universal newlines mode (deprecated)
默认模式为
'r'(打开以读取文本,为的同义词
'rt')。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)