Python File 打开模式
单选题 简单
题目
什么做 `打开('file.txt', 'w')` 做如果 file exists?
提示
'w' stands for 编写.
解释
模式 'w' 打开 file for 编写. 如果 file exists, 它的内容是 truncated (emptied). 如果它 做不 exist, 新 file 是创建. Use '' 到 append 不使用 truncating, and 'r' 到读取.
相关资源
相关课程
- File Handling
File 模式.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。