saveDataIntoText(name) # print "File Created" def makefirstline(name): try: text_file = open(getFileName(name), "a") text_file.write(data["title"][:14]+","+data["title"][17:-4]+","+data["title"][-2:]+","+data["geo"]["lat"]+","+data["geo"]["long"]+"\n") text_file.close() except: print 'Error making the file ', name def getFileName(name): workingpath = os.getcwd()[:-3] nameofData = workingpath+name+".txt" return nameofData def getFileLocation(name): workingpath = os.getcwd()[:-3] nameofData = workingpath+"web_data\\"+name+".txt" return nameofData def main(zipcode): global data print 'Collecting Data from ', zipcode data = wwc.getWeatherData(zipcode) makeNewTextFile(zipcode) #tes = main('91780') tes = wwc.getWeatherData('91780')
def main(zipcode): global data print 'Collecting Data from ', zipcode data = wwc.getWeatherData(zipcode) makeNewTextFile(zipcode)
def getWeatherData(zipcode): wwc.getWeatherData(zipcode)