pyparsing frames and tweens - take 2

Donn Ingle donn.ingle at gmail.com
Mon Nov 5 08:33:25 EST 2007


Paul,

> frame = Literal("#")
> tween = Word("-") # that is, it is a "word" composed of 1 or more -'s
> copy = Literal("=")
> blank = Literal("_")
> 
> animation = OneOrMore((frame + Optional(
> (tween + FollowedBy(frame)) |
> OneOrMore(copy | blank) ) ) )

I found that this form insists on having a # in char 0. How could it be
changed to take a bunch of blanks before the first frame?
____# ?

I have tried:
animation = OneOrMore( 
Optional ( blank | frame ) +
Optional( (tween + FollowedBy(frame) ) |  OneOrMore(copy | blank)  )  
)

And permutations thereof, but it goes into a black hole.

\d




More information about the Python-list mailing list