Python path and append

Chris Angelico rosuav at gmail.com
Mon Apr 25 20:25:46 EDT 2016


On Tue, Apr 26, 2016 at 7:26 AM, John Gordon <gordon at panix.com> wrote:
> It's much easier to create a new file and then rename it afterwards,
> instead of rewriting the original file.

And more importantly, it's safer. If anything happens to your process
while it's doing its work, you'll have a junk file sitting around, but
you won't have lost everything. If you overwrite the existing file,
you (often) depend on completely writing out the content you have in
memory.

ChrisA



More information about the Python-list mailing list