[Bf-python] svg2obj script.

Martin Poirier theeth at yahoo.com
Wed Mar 28 17:35:32 CEST 2007


--- jmsoler at free.fr wrote:

> Selon Campbell Barton <cbarton at metavr.com>:
> 
> > jmsoler at free.fr wrote:
> > > Selon Martin Poirier <theeth at yahoo.com>:
> > >
> > >> --- Campbell Barton <cbarton at metavr.com> wrote:
> > >>
> > >>> Hi JMS, can you resolve this?
> > >>>
> > >>>
> > >>>   File
> > >>>
> "/root/.blender/scripts/bpymodules/svg2obj.py", line
> > >>> 1086, in
> > >>> control_CONTAINT
> > >>>      while txt.count(')',t0)>0:
> > >>> TypeError: count() takes exactly one argument
> (2
> > >>> given)
> > >>>
> > >
> > > Seems that you have a problem with your python.
> > > Try to read this :
> http://docs.python.org/lib/string-methods.html
> > > count(  	sub[, start[, end]])
> > >     Return the number of occurrences of
> substring sub in string
> > S[start:end].
> > > Optional arguments start and end are interpreted
> as in slice notation.
> >
> > Ok, well Im sure I wont be the only person who'll
> come across this problem.
> >
> > count is a builtin and Im using 2.4 and 2.5, at
> the moment I think we
> > support python 2.3
> >
> >
> > Any other comments?
> >
> >
> >
> 
> Count is a string method, not a list one. It should
> works on 2.4 and it does.
> Why not on the 2.5 ?

It's a list method too and the list version doesn't
take start/end indexes, contrary to the string version
(which, incidentally is the same in 2.3/2.4/2.5 and
earlier even).

So, the exception is most likely caused by that
function receiving a list instead of a string.

Cam, does it happen every time or only on specific svg
files? Also, does it happen without your
modifications? (just making sure)

Martin


 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 



More information about the Bf-python mailing list