By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,402 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,402 IT Pros & Developers. It's quick & easy.

format requires a mapping?

P: n/a
what is python trying to tell me here? does it have to do with
formatting the string.

Keywords and Zinger are fields in my database.

print """<tr>
<td class="padplace" width="120">Keywords</td>
<td class="padplace" idth="660">Zinger</td><td>

TypeError: format requires a mapping


thanks much in advance,

-rsr-

Nov 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ronrsr wrote:
what is python trying to tell me here? does it have to do with
formatting the string.

Keywords and Zinger are fields in my database.

print """<tr>
<td class="padplace" width="120">Keywords</td>
<td class="padplace" idth="660">Zinger</td><td>

TypeError: format requires a mapping
portions of your code and the traceback appears to be missing, so it's a
bit hard to tell what you're really doing here, but that error message
usually means that you're using the % string formatting operator with
named placeholders in the string template, but with something that's not
a dictionary as the data. an example:
>>"%(name)s" % 10
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: format requires a mapping

either switch to positional markers, or put the data in a dictionary (or
any other object that implements the mapping interface).

</F>

Nov 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.