【发布时间】:2014-05-27 21:07:04
【问题描述】:
这里有好几次我看到人们使用rt 和wt 模式来读写文件。
例如:
with open('input.txt', 'rt') as input_file:
with open('output.txt', 'wt') as output_file:
...
我没有看到 documented 模式,但由于 open() 不会引发错误 - 看起来使用起来非常合法。
使用wt 与w 和rt 与r 有什么区别?
【问题讨论】:
标签: python file file-io read-write