-7

I am having trouble understanding how to do this. The purpose of this is going to have a different module call to this function have it return the correct url which will than be downloaded and have things extracted from it.

getQuery(location) returns a URL containing a GET query to retrieve the weather from wunderground.com for a given location.

For example, getQuery('Princeton, WV') returns the URL

http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query=Princeton%2C+WV
casperOne
  • 73,706
  • 19
  • 184
  • 253
Corey Quick
  • 1
  • 1
  • 3
  • you question isn't clear. please add some info on what is the problem and what's not working. – Amirshk Apr 14 '13 at 23:22
  • what library are you using? and what are you trying to accomplish/whats not working? – Sanketh Katta Apr 14 '13 at 23:22
  • Feed it a dictionary? `{'getkey' : 'value'}` –  Apr 14 '13 at 23:23
  • possible duplicate of [Python retrieving information from the web for a weather widget](http://stackoverflow.com/questions/16005141/python-retrieving-information-from-the-web-for-a-weather-widget) – Blender Apr 14 '13 at 23:24
  • 2
    C'mon. Now you're going to ask an individual question for every function in your assignment? – Blender Apr 14 '13 at 23:25

1 Answers1

2
def getQuery(location):
   # return your root url plus the location encoded using quote_plus
   # http://docs.python.org/2/library/urllib.html#urllib.quote_plus
   pass
dm03514
  • 54,664
  • 18
  • 108
  • 145