[Zope] urllib.urlopen

David Siedband david at calteg.org
Sun Aug 15 18:33:00 EDT 2004


I'm trying to grab a data file using urllib.urlopen

with this code:

def powerData(self,REQUEST):
    import csv
    import urllib
    inFile =  
urllib.urlopen('http://www.davisenergy.com/zeh_data/A042304.DAT')

return inFile

but I get the error:
global name 'inFile' is not defined

I've also tried some variations on this:

    inFile =  
"".join(urllib.urlopen('http://www.davisenergy.com/zeh_data/ 
A042304.DAT').readlines())


Ideas on what's not working?  thanks

--
David



More information about the Zope mailing list