converting from shell script to python

Stewart Midwinter stewart.midwinter at gmail.com
Thu Jan 5 16:45:09 EST 2006


Greg Ewing (using news.cis.dfn.de) wrote:
> Alternatively, you can substitute things from a
> dictionary instead of a tuple:
>
>    vars = {'ROOTDIR': '/usr/lib'}
>    CLASSPATH = \
>      "%{ROOTDIR}s/a/a.jar:%{ROOTDIR}s/b/b.jar:%{ROOTDIR}s/c/c.jar" % vars

Arriving late at the party (found this while searching for something else)...

This is a useful construct, but won't work as written. In the
CLASSPATH assignment, you have to use regular brackets around ROOTDIR,
not dictionary-type brackets.

S



More information about the Python-list mailing list