title: URL encoding in python
body: <p>Is there a simple method I'm missing in <code>urllib</code> or other library for this task?  URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.</p>
  
  <p>Here's an example of an input and my expected output:</p>
  
  <pre><code>Mozilla/5.0 (Linux; U; Android 4.0; xx-xx; Galaxy Nexus Build/IFL10C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
  
  Mozilla%2F5.0+%28Linux%3B+U%3B+Android+4.0%3B+xx-xx%3B+Galaxy+Nexus+Build%2FIFL10C%29+AppleWebKit%2F534.30+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F534.30
  </code></pre>