[Bf-python] svg2obj script.

jmsoler at free.fr jmsoler at free.fr
Wed Mar 28 18:11:40 CEST 2007


Selon Campbell Barton <cbarton at metavr.com>:

> jmsoler at free.fr wrote:
> > Selon Martin Poirier <theeth at yahoo.com>:
> >
> >
> >> The part that removes redundant spaces can be factored
> >> out too.
> >>
> >> def remSpaces(txt):
> >>     t1 = txt
> >>     t2 = txt.replace("  ", " ")
> >>     while len(t1) != len(t2):
> >>         t1 = t2
> >>         t2 = t1.replace("  ", " ")
> >>
> >
> >
> >
> > And you really believe that the code that you suggest above is
> > simpler and faster than :
> >    while '  ' in t2: t2=t2.replace('  ',' ')
> >
> > jms
>
> Of course its faster, one less lookup per cycle,
>
> while '  ' in t2: is a lookup
>
> Where martins example just checks that theres always a change in the
> string size.
>

Ok, I understand.

>
>  > Cam, does it happen every time or only on specific svg
>  > files? Also, does it happen without your
>  > modifications? (just making sure)
>
>
> The error happened for the 2 svg files I tried to import. both fairly
> simple and from inkscape.

I have found where is the problem. It dates from the last modifs
made to remove the use of exec.




More information about the Bf-python mailing list