TypeError: iterable argument required

  • Thread starter Íéêüëáïò Êïýñáò
  • Start date
Í

Íéêüëáïò Êïýñáò

Hello, after inserting this line if "@" in mail and comment not in
("Ó÷ïëéÜóôå Þ ñùôÞóôå ìå ó÷åôéêÜ....", ""):

iam getting the following error which i dont understand

**************************************************************
163 # insert guest comments into database if form was
submitted
164 if "@" in mail and comment not in ("Ó÷ïëéÜóôå Þ ñùôÞóôå
ìå ó÷åôéêÜ....", ""):
165 try:
166 cursor.execute( '''INSERT INTO
users(mail, comment) VALUES(%s, %s)''', (mail, comment) )
mail = None, comment = None

TypeError: iterable argument required
args = ('iterable argument required',)
**************************************************************

can you help please?
 
M

MRAB

Hello, after inserting this line if "@" in mail and comment not in
("Ó÷ïëéÜóôå Þ ñùôÞóôå ìå ó÷åôéêÜ....", ""):

iam getting the following error which i dont understand

**************************************************************
163 # insert guest comments into database if form was
submitted
164 if "@" in mail and comment not in ("Ó÷ïëéÜóôå Þ ñùôÞóôå
ìå ó÷åôéêÜ....", ""):
165 try:
166 cursor.execute( '''INSERT INTO
users(mail, comment) VALUES(%s, %s)''', (mail, comment) )
mail = None, comment = None

TypeError: iterable argument required
args = ('iterable argument required',)
**************************************************************

can you help please?

Which version of Python?

Can you please paste those few lines of code (say, lines 163 to 170).

I can't see what the "mail = None, comment = None" is meant to be.
 
C

Chris Angelico

2011/4/3 MRAB said:
I can't see what the "mail = None, comment = None" is meant to be.

If this is to reset the two variables after inserting into the
database, you may want to use either:

mail = None; comment = None # semicolon not comma
or
mail = comment = None # chaining assignment

Is that the line with the error, though?

Chris Angelico
 
Í

Íéêüëáïò Êïýñáò

Which version of Python?

Can you please paste those few lines of code (say, lines 163 to 170).

I can't see what the "mail = None, comment = None" is meant to be.

Is the same lines i posted in the 1st post

**************************************************************
# insert guest comments into database if form was submitted
if "@" in mail and comment not in ("Σχολιάστε ή Ïωτήστε με
σχετικά....", ""):
try:
cursor.execute( '''INSERT INTO users(mail, comment) VALUES(%s,
%s)''', (mail, comment) )
except MySQLdb.Error:
print ( "Error %d: %s" % (e.args[0], e.args[1]) )
**************************************************************

Also both mail and comment variables are taken from input in form
fields.

mail = form.getvalue('mail')
comment = form.getvalue('comment')
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top