#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()
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.