title: URL generator in python
body: <p>I've got an url which got the following pattern:</p>
  
  <pre><code>http://www.xf.com/position/?number=1&amp;From=top&amp;To=bottom
  </code></pre>
  
  <p>I want to generate a crawl listing given a list of position</p>
  
  <pre><code>positionToCrawl = [top, bottom, left, center, right]
  </code></pre>
  
  <p>I will iterate over that list but what I want to do is create an url, like:</p>
  
  <pre><code>http://www.xf.com/position/?number=1&amp;From=X&amp;To=Y
  </code></pre>
  
  <p>And to be able to replace X and Y with the element of my list, like</p>
  
  <pre><code>URLToReplace = http://www.xf.com/position/?number=1&amp;From=X&amp;To=Y
  URLToCrawl = replaceElementXY(URLToReplace, "left", "right")
  print URLToCrawl // Display: http://www.xf.com/position/?number=1&amp;From=left&amp;To=right 
  </code></pre>
  
  <p>If you guys know a library that do something like that would be great other way, I guess I will have to implement it, but I'm sure this has already been implemented, but I didn't find it.</p>