通常需要在文件对象上调用.close()方法或使用"with open"构造来确保它被关闭.
但是,我想知道写入这样的文件是否会使文件关闭:
open(path,'w').writelines(fileContents)
python
python ×1