The class GoogleSuggest will help you to grab the Google suggestion(s) for given expression.
Note: The urllib2 module has been split across several modules in Python 3.0 named urllib.request and urllib.error. The 2to3 tool will automatically adapt imports when converting your sources to 3.0.
Example and output:
>>> ================================ RESTART ================================
>>>
>>> suggestions = GoogleSuggest("daniweb").read()
>>> for suggest in suggestions:
print suggest
daniweb
daniweb llc
daniweb wiki
daniweb popup
daniweb c++
daniweb forum
daniweb java
daniweb login
daniweb php
daniweb python
>>> suggestion = GoogleSuggest().read("google")
>>> for suggest in suggestion:
print suggest
google maps
google.com
google earth
google translate
google voice
google images
google docs
google scholar
google chrome
google books
>>>