if arcpy.GetParameterAsText(2): logBadData = arcpy.GetParameterAsText(2) else: logBadData = "R:\\test_pGDB"
### # Create Output Files ### #output log Bad Data timeStamp = "2012_07_10" # or whatever, use a function to stamp it! fBad = open(logBadData+"_"+timeStamp+".txt",'w')
def tbxPrint(fBad,inStr): '''a general purpose function for try/except printing inside a toolbox function''' try: arcpy.AddMessage(inStr) except: print inStr finally: fBad.write(inStr+"\n")
tbxPrint(fBad,"\n \n \n Created "+PathAndNameGDB) tbxPrint(fBad,"\n with log file "+logBadData+"\n \n ")
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.