file
=
open
(
"newfile.txt"
,
"w"
)
.write(
"写入字符串在文件里"
.close()
"r"
print
.read())
结果
>>>
写入字符串在文件里