Aaron Elbaz wrote:
> Hi,
> 
> I'm having difficulty understanding why the following code doesn't work:
> 
> 
> getfr.py
> #import pymetar
> #
> #class wReport:
> #    def __init__(self,metarcode="CYYC"): #weather for calgary INTL
> #        self.METARCODE=metarcode
> #        rf=pymetar.ReportFetcher(self.METARCODE)
> #        rep=rf.FetchReport()
> #        pr=rp.ParseReport(rep)
> #    def getRep()
> #        return pr.getFullReport

You never assign to rp so it is undefined, which is what the error message is 
telling you.

Looking at the pymetar example you are missing the line
rp=pymetar.ReportParser()

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to