Python weather application

2007-08-30 Thread seancron
Does anybody have any suggestions for getting started on desigining a
desktop weather application in Python?

I've been looking for access to weather data and while I have found
several including the weather.com service I've decided to use the
Yahoo! Rss Weather feed since it doesn't have a license like the
weather.com service does. However one problem I have with it is that
it only accepts zip codes or locations ids.  So if a user was to enter
the name of the city instead of those two there would be an error. I
could make it so they could only enter in the location code or zip
code but I would really prefer to have it be automatically corrected.
Does anyone have ideas on how to go about this or have an other
suggestions?

Thanks,
Sean

-- 
http://mail.python.org/mailman/listinfo/python-list


Python weather application

2007-08-30 Thread seancron
Does anybody have any suggestions for getting started on desigining a
desktop weather application in Python?

I've been looking for access to weather data and while I have found
several including the weather.com service I've decided to use the
Yahoo! Rss Weather feed since it doesn't have a license like the
weather.com service does. However one problem I have with it is that
it only accepts zip codes or locations ids.  So if a user was to enter
the name of the city instead of those two there would be an error. I
could make it so they could only enter in the location code or zip
code but I would really prefer to have it be automatically corrected.
Does anyone have ideas on how to go about this or have an other
suggestions?

Thanks,
Sean

-- 
http://mail.python.org/mailman/listinfo/python-list


parsing response from SOAPpy request

2007-08-31 Thread seancron
I'm using SOAPpy to access weather data from the NOAA National Digital
Forecast Database XML Web Service [1] and I've been having
trouble figuring out how to parse the data.

The response comes back as XML document but when I check it with
type(result) it shows the the response is a string.  Does anyone have
any
suggestions on getting relevant data?

Thanks,
-Sean

[1] http://www.weather.gov/forecasts/xml/

-- 
http://mail.python.org/mailman/listinfo/python-list


nameerror upon calling function

2007-09-01 Thread seancron
Hi,

I have a program that makes a call to a function in a different python
script that I wrote.  But, when I call the function I get the
following error:

NameError: global name 'WSDL' is not defined

I can't figure out why I'm getting this error since WSDL should be
defined. Here are the two scripts:

weatherpy.py
from xml.dom import minidom
from SOAPpy import WSDL
from libndfdsoap import ByDaySOAPRequest

wsdlfile = 'http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/
ndfdXML.wsdl'

if __name__ == '__main__':
ByDaySOAPRequest(39., -77., 2004-04-27, 7, '12 hourly')

libndfdsoap.py
def ByDaySOAPRequest(latitude, longitude, startDate, numDays,
hrFormat):
"""Sends a SOAP request using the NDFDgenByDay method and stores
the
response in a file called weather.xml"""

wsdlfile = 'http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/
ndfdXML.wsdl'
server = WSDL.Proxy(wsdlfile)
response = server.NDFDgenByDay(latitude, longitude, startDate,
numDays,
   hrFormat)
xml = open('/weather.xml', 'w')
xml.write(response)
xml.close()
return

Can somebody please show me how to fix this error?

Thanks,

-Sean

-- 
http://mail.python.org/mailman/listinfo/python-list