title: Programmatically searching google in Python using custom search
body: <p>I have a snippet of code using the pygoogle python module that allows me to programmatically search for some term in google succintly:</p>
  
  <pre><code> g = pygoogle(search_term)
   g.pages = 1
   results = g.get_urls()[0:10]
  </code></pre>
  
  <p>I just found out that this has been discontinued unfortunately and replaced by something called the google custom search. I looked at the other related questions on SO but didn't find anything I could use. I have two questions:</p>
  
  <p>1) Does google custom search allow me to do exactly what I am doing in the three lines above?</p>
  
  <p>2) If yes - where can I find example code to do exactly what I am doing above? If no then what is the alternative to do what I did using pygoogle?</p>