title: How to escape a pipe ( | ) symbol for url_encode in python
body: <p>I am facing a problem with urllib.url_encode  in python. Bets explained with some code:</p>
  
  <pre><code>&gt;&gt;&gt; from urllib import urlencode
  &gt;&gt;&gt; params = {'p' : '1 2 3 4 5&amp;6', 'l' : 'ab|cd|ef'}
  &gt;&gt;&gt; urlencode(params)
  'p=1+2+3+4+5%266&amp;l=ab%7Ccd%7Cef'
  </code></pre>
  
  <p>I want to keep the pipes ('|') in to l parameter. can you please tell me how?</p>
  
  <p>The result should be</p>
  
  <pre><code>'p=1+2+3+4+5%266&amp;l=ab|cd|ef'
  </code></pre>
  
  <p>PS: I do not want to put together the URL manually, but use urlencode for that.</p>
  
  <p>Thanks 
  -Pat</p>