Stupid string formatting question

Michael S. Fischer michael at dynamine.net
Thu May 16 22:11:21 EDT 2002


On Thu, May 16, 2002 at 07:03:47PM -0700, Sean 'Shaleh' Perry wrote:

> > OK, here's an example.
> > 
> >     >>> def x():
> >     ...   return "a", "b"
> >     ... 
> >     >>> print "%s/%s/%s/%s" % ("hi", "there", x())
> >     Traceback (most recent call last):
> >       File "<stdin>", line 1, in ?
> >     TypeError: not enough arguments for format string
> > 
> 
> you just returned ("hi, "there", ("a", "b")) which is len(3) not 4.

OK.  What can I do to make this work?

-- 
Michael S. Fischer / michael at dynamine.net / +1 650-533-4684
Lead Hacketeer, Dynamine Consulting, Silicon Valley, CA





More information about the Python-list mailing list