Parsing csh scripts with python

gene tani gene.tani at gmail.com
Wed Mar 29 10:23:37 EST 2006


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.




More information about the Python-list mailing list