专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅
这里我们将对代码试图读取out.txt时候结果为空此文件是被缓冲处理并且还没有写入当此with语句完成时候Python会关闭此文件所以最后行代码会认定out.txt内容确是大写文字 =dp-py>=alt>open(=>'in.txt', =>'w').write(=>'abc def') with open(=>'in.txt') as in_file: =alt>with open(=>'out.txt', =>'w') as out_file: text = in_file.read =alt>=keyword>assert text =>'abc def' te [阅读全文] [PDF]
1 共1条 分1页