Python3 将内容写入文件 # 打开「detail_content」文件 fout = open('detail_content', 'w', encoding='utf8') # 写入文件内容 fout.write(content) 关闭文件 fout.close()