[Bf-python] svg2obj script.

jmsoler at free.fr jmsoler at free.fr
Wed Mar 28 17:42:24 CEST 2007


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



More information about the Bf-python mailing list