TypeError: iterable argument required

Νικόλαος Κούρας nikos.kouras at gmail.com
Sat Apr 2 23:02:54 CEST 2011


On 2 Απρ, 19:50, MRAB <pyt... at mrabarnett.plus.com> wrote:
> On 02/04/2011 17:26, Íéêüëáïò Êïýñáò wrote:
>
>
>
>
>
>
>
>
>
> > 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.

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')



More information about the Python-list mailing list