#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()
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.