This is something that I think would be very useful.  Basically, I'd like there to be a way to edit Python source programmatically without requiring human intervention.  There are a couple of things I would like to do with this:

Edit the configuration of Python apps that use source modules for configuration.
Set up a "template" so that I can customize a Python source file on the fly.  This way, I can set up a "project" system on an open source app I'm working on and allow certain files to be customized.

I could probably write something that can do this myself, but I can see that opening up a lot of "devil's in the details" type issues.  Are there any ways to do this currently, or am I just going to have to bite the bullet and implement it myself?
I had the same issue and I simply opened the file and did some replace: then reload the file in the Python interpreter. This works fine and is easy to do. 
Otherwise AFAIK you have to use some conf objects.
Programmatically editing Python source