[Tutor] Named-value formatting fails

Steven D'Aprano steve at pearwood.info
Sun Jan 9 05:18:25 CET 2011


There's a shorter answer and a longer answer to this question. The 
shorter answer is here. The longer answer will follow.

Tim Johnson wrote:
> I'm using 2.6.5 on ubuntu 10.04.
> I'm evaluating a very large string using a named-value formatting
> scheme. The process fails with the following error message:
> """not enough arguments for format string"""
...
> self.content = content % Evalx()
...
> I don't really know how to debug this, except for to look for some
> "%s" in the `content' string.

Er, that would be a good start. Without knowing what string is on the 
left side of the % operator, how do you know how many items need to be 
on the right side?



-- 
Steven


More information about the Tutor mailing list