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 ")
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.