13,420
edits
Changes
→PART 2 - Writing To Files
== PART 2 - Writing To Files ==
:'''Perform the Following Steps:'''
:x <blockquote style="margin-left:35px;">{{Admon/caution|style="padding-left:25px"|xRisk of Losing File Contents|ExA common problem that new Python programmers may encounter is accidentally erasing the existing contents of a file when writing data to a file. When opening files for writing, Python assumes content in the file is no longer wanted and it's immediately deleted; therefore, if in doubt, append new data to the file instead!}}</blockquote>
::#To start, open the ipython3 shell:<source lang="python">
ipython3