Urllib.encode() - How does it Treat a List?

  • Thread starter =?ISO-8859-1?Q?Gregory_Pi=F1ero?=
  • Start date
?

=?ISO-8859-1?Q?Gregory_Pi=F1ero?=

Hi Wise Python Folk,

Here's my code:
p={'type':'bar','title':'Gregs Chart 1','values':[1,2,3],'labels':[1,2,3]}
urllib.urlencode(p)
'values=%5B1%2C+2%2C+3%5D&labels=%5B1%2C+2%2C+3%5D&type=bar&title=Gregs+Chart+1'

Now I just can't figure out what it's giving me for say values? What
is that stuff? What I want is to create a url and pass it a list of
values, ie so that in the script accepting these parameters I can do:

form = cgi.FieldStorage()
values=form.getlist('value')

and values will equal a list with 1,2, 3 or at least '1', '2', '3'

Much thanks in advance!
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top