第 17 步:我们已准备好写入文件。这样做就像使用两个工具包块一样简单!
csv . writer( my_file )创建一个可以写入特定 CSV 文件的对象。
- 在主题和,将Create Writer update_high_scores() 。
- 然后,将Write Row to CSV下方和内部update _high_scores () 。
- 最后,让我们关闭我们的文件!将Close File拖到您的 for 循环下方。它应该只缩进4 个空格。
To navigate the page using the TAB key, first press ESC to exit the code editor.