Bash-like brace expansion

Peter Waller peter.waller at
Tue Mar 24 13:51:34 CET 2009

2009/3/24 Tino Wildenhain <tino at>
> 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]))




- Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list