title: convert curl to urllib python3
body: <p>I tried to convert this CURL command to urllib</p>
  
  <p>curl:</p>
  
  <pre><code>curl -X POST 'http://118.tct.ir/exe/indseane17.pgm' --data 'cmbPro=%CA%E5%D1%C7%E4%0D%0A&amp;pcity=021+++++&amp;lname=%C7%E3%ED%D1%C7%E3%CC%CF%ED&amp;fname=%CD%D3%E4&amp;adrs=&amp;hideme=PZ83M6S2W7'
  </code></pre>
  
  <p>urllib:</p>
  
  <pre><code>from urllib.request import Request, urlopen
  import urllib
  data = urllib.parse.urlencode({
       'cmbPro':'%CA%E5%D1%C7%E4%0D%0A',
       'pcity':'021+++++',
       'lname':'%C7%E3%ED%D1%C7%E3%CC%CF%ED',
       'fname':'%CD%D3%E4&amp;adrs=&amp;hideme=PZ83M6S2W7'
       })
  data = data.encode('ascii')
  q = Request('http://118.tct.ir/exe/indseane17.pgm',data=data)
  
  a = urlopen(q).read()
  print(a)
  </code></pre>
  
  <p>but I've got this error:</p>
  
  <pre><code>HTTPError: HTTP Error 404: Not Found
  </code></pre>
  
  <p>But when I try it with curl it simply works just fine.</p>
  
  <p>What's the problem?</p>