From the course: Learning ArcGIS Python Scripting
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Solution: Describe feature classes and write to a file - ArcGIS Pro Tutorial
From the course: Learning ArcGIS Python Scripting
Solution: Describe feature classes and write to a file
(upbeat synth music) - [Instructor] Hey, how'd that go for you? Did you get your script working? I'm going to show you how I solved this problem. But if your script looks a little different, that's okay. Lots of ways to get something done in scripting, as long as it works. So the way I did it is I imported arcpy, and I also imported sys. I need that sys to be able to do the file writing. And then I'll set my current workspace with arcpy.env.workspace. I'm going to set it equal to the Baytown geodatabase. Next, I'll set the output file. I'll open it up and get it ready to receive some new information. I'll do that with outfile = open. I'm going to send the output to the same PythonPracticeProject folder. And I'm going to call the file NAD27Datasets.txt. I'll need to open it with write permission, so I have to put a little w on the end there. So now I have my current workspace set, and I've set up my outfile. Now I'm ready to loop through all the feature classes in this geodatabase. So…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Read from and write to a text file5m 47s
-
(Locked)
Write a script that reads from and writes to a file9m 16s
-
(Locked)
Write a script that records broken links8m 28s
-
(Locked)
Challenge: Describe feature classes and write to a file1m 33s
-
(Locked)
Solution: Describe feature classes and write to a file5m 6s
-
(Locked)
-
-
-