Ian Leitch wrote: > >>> from urlparse import urlparse > >>> dict([n for n in [i.split('=') for i in > urlparse('http://www.somesite.com/cgi-bin/foo.cgi?name=john&age=90')[4].split('&')]]) > {'age': '90', 'name': 'john'}
Ian, thanks for the reply, but that is not what I need to do. Inside foo.cgi how can I parse out the values given in the URL? So if you visit: http://www.somesite.com/cgi-bin/foo.cgi?valA=1&valB=2 .....I want the script, foo.cgi to print out the parameters and their values. It's dynamic so the values are url wont be the same all the time. How do i get the URL from the script? does this make sense? So I'm thinking foo.cgi will look like [code] url = getTheFullURL() parse(url) def parse(url): # parse the parameter names and values [/code] -- http://mail.python.org/mailman/listinfo/python-list