Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2470

Re: TypeError: iterable argument required

From Νικόλαος Κούρας <nikos.kouras@gmail.com>
Newsgroups comp.lang.python
Subject Re: TypeError: iterable argument required
Date 2011-04-02 14:02 -0700
Organization http://groups.google.com
Message-ID <e638f3a5-6098-4231-b20f-aa9c72917c8b@32g2000vbe.googlegroups.com> (permalink)
References <3902dc1f-90bb-4602-9938-402a3582aa84@v31g2000vbs.googlegroups.com> <mailman.130.1301763047.2990.python-list@python.org>

Show all headers | View raw


On 2 Απρ, 19:50, MRAB <pyt...@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')

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

TypeError: iterable argument required Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2011-04-02 09:26 -0700
  Re: TypeError: iterable argument required MRAB <python@mrabarnett.plus.com> - 2011-04-02 17:50 +0100
    Re: TypeError: iterable argument required Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2011-04-02 14:02 -0700
  Re: TypeError: iterable argument required Chris Angelico <rosuav@gmail.com> - 2011-04-03 05:31 +1000

csiph-web