2009/3/24 Tino Wildenhain <t...@living-examples.com>
>
>
> The simple {foo} expansion you mention should be quite easily handled
> with re.sub and a function as argument. So not much more then a few
> lines of code.


Could this approach be made to handle recursive expansion? From the example
with the script:

pprint(BraceExpand("electron_{n,{pt,eta,phi}[{1,2}]}", ordering = [True]))

Gives:

['electron_n',
 'electron_pt[1]',
 'electron_eta[1]',
 'electron_phi[1]',
 'electron_pt[2]',
 'electron_eta[2]',
 'electron_phi[2]']

Cheers,

- Pete
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to