Popular recipes by Mitch Chapman http://code.activestate.com/recipes/users/98085/2001-05-08T23:12:33-07:00ActiveState Code RecipesSaving backups when writing files (Python) 2001-05-08T23:12:33-07:00Mitch Chapmanhttp://code.activestate.com/recipes/users/98085/http://code.activestate.com/recipes/52277-saving-backups-when-writing-files/ <p style="color: grey"> Python recipe 52277 by <a href="/recipes/users/98085/">Mitch Chapman</a> . Revision 2. </p> <p>Before overwriting an existing file it's often desirable to make a backup. This recipe emulates the behavior of Emacs by saving versioned backups. It's also compatible with the marshal module, so you can save versioned output in "marshal" format.</p>