Developing a project of mine I realize I have a need for some level of persistence across sessions, for example when a user executes the application, changes some preferences and then closes the app.  The next time the user executes the app, be it after a reboot or 15 minutes, I would like to be able to retain the preferences that had been changed.  
My question relates to this persistence.  Whether programming an application using the win32 API or the MFC Framework .. or using the newer tools for higher level languages such as wxPython or wxRuby, how does one maintain the type of persistence I refer to?  Is it done as a temporary file written to the disk?  Is it saved into some registry setting?  Is there some other layer it is stored in that I am unaware of?
I would advice to do it in two steps.

First step is to save your prefs. as
string, for that you can
a)
Use any xml lib or output xml by
hand    to output string and read
similarly    from string
b) Just use pickle module to dump your prefs object as a string
c) Somehow generate a string from prefs which you can read back as prefs e.g. use yaml, config , JSON etc actually JSON is a good option when simplejson makes it so easy.
Once you have your methods to convert to and from string are ready, you just need to store it somewhere where it is persisted and you can read back next time, for that you can
a) Use wx.Config which save to registry in windows and to other places depending on platform so you don't have to worry where it saves, you can just read back values in platform independent way. But if you wish you can just use wx.Config for directly saving reading prefs.
b) Directly save prefs. string to a file in a folder assigned by OS to your app e.g. app data folder in windows.

Benefit of saving to a string and than using wx.Config to save it, is that you can easily change where data is saved in future e.g. in future if there is a need to upload prefs. you can just upload prefs. string.
Windows Application Programming & wxPython