format requires a mapping?

R

ronrsr

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-
 
F

Fredrik Lundh

ronrsr said:
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:
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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top