well the indentation is already preserved when i write the syntax.
import arcpy.mapping as mapping, os path = r"C:" f = open('filename_here.txt','w') for root,dirs,files in os.walk(path): for filename in files: basename, extension = os.path.splitext(filename) if extension == ".mxd": fullPath = os.path.join(path,filename) mxd = mapping.MapDocument(fullPath) f.write("MXD: " + filename + "\n") brknList = mapping.ListBrokenDataSources(mxd) for brknItem in brknList: f.write("\t" + brknItem.name + "\n") f.close()
fullPath = os.path.join(root,filename)
import arcpy.mapping as mapping, os path = r"C:" f = open('filename_here.txt','w') for root,dirs,files in os.walk(path): for filename in files: basename, extension = os.path.splitext(filename) if extension == ".mxd": fullPath = os.path.join(root,filename) mxd = mapping.MapDocument(fullPath) f.write("MXD: " + filename + "\n") brknList = mapping.ListBrokenDataSources(mxd) for brknItem in brknList: f.write("\t" + brknItem.name + "\n") f.close()
You need to tell us what the exact error is, it's very important. Copy the entire error message and post it here.Also, please enclose your python code in [noparse][/noparse] tags to preserve the indentation. This is very important as indentation is is part of the syntax. See this post for further information.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.