title: Best way to parse a URL query string
body: <p>What is the best way to parse data out of a URL query string (for instance, data appended to the URL by a form) in python?  My goal is to accept form data and display it on the same page.  I've researched several methods that aren't quite what I'm looking for. </p>
  
  <p>I'm creating a simple web server with the goal of learning about sockets.  This web server won't be used for anything but testing purposes.</p>
  
  <pre><code>GET /?1pm=sample&amp;2pm=&amp;3pm=&amp;4pm=&amp;5pm= HTTP/1.1
  Host: localhost:50000
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-us,en;q=0.5
  Accept-Encoding: gzip, deflate
  Connection: keep-alive
  Referer: http://localhost:50000/?1pm=sample&amp;2pm=&amp;3pm=&amp;4pm=&amp;5pm=
  </code></pre>