Dave Benjamin wrote: > On Tue, 28 Mar 2006, David Hirschfield wrote: > > > I need to be able to parse the script, modify some variable settings and > > then write the script back out so that the only changes are the > > variables I've modified (comments, ordering of statements, etc. must > > remain the same). > > > > I looked at shlex, but I don't think it will do what I need. > > What about regular expressions? >
probably overkill here, but you might want to look into one of python's templating libs. They make generating lots of "similar except for..." code and markup relatively painless. -- http://mail.python.org/mailman/listinfo/python-list