Hi I'm working with shapefiles and I'm having trouble in my intro to programming class. The first block of code works, but when I run LN(4) I get error code 000229. I have confirmed the file oil_platforms.shp exists. Any pointers? I feel like I have tried everything to solve this.
Please post the code itself, not a picture. Images are not legible on all devices, and would require retying your code to test or recommend a solution.
- V
Will do in the future. Thank you.
The leading slash in "notebook_path" probably won't work on Windows. It makes it an absolute path and so Windows throws a drive letter in there for you. Z:
You could use a complete path like "C:/Users/YOURLOGINNAMEHERE/arcgis/home/" or it could be relative to the current folder if you leave the leading slash off like just "arcgis/home" if your data is in the local folder.
I use tests a lot like
import os
if not os.path.exists(notebook_folder): print("THE PATH DOES NOT EXIST!!")
A handy shortcut to copying paths in Windows is hold shift > right click > copy path. You will get something like this "C:\temp\some.shp" in your clipboard (even with the quotes). Because combos of backslashes and characters can be escapes in Python, exercise caution by making a habit of using raw strings by prefixing your path strings with the letter r (e.g. r"C:\temp\input.csv") in your script.
Tyler