#oLoc is just a network path string variable where I want to save this #strD1 and strD2 are just variables of dates set previously logpath = oLoc + "\\" + strD1 + "_to_" + strD2 + ".log" logfile = open(logpath, 'w') logfile.write("Log begin: " + str(log_startdate) + "\n") #here is an example of how I am writting errors to the log file # see if spatial analyst extension is available for use availability = gp.CheckExtension("Spatial") if availability=="Available": gp.CheckOutExtension("Spatial") else: logfile.write("ERROR: Spatial Analyst extension not available" + "\n") return logfile.close()
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.