I am new to ArcPy and python. I am currently working on exercise 9.2 in Python Scripting for ArcGIS by Paul Zanbrtgen. The question is pretty simple and is asking to write a scrip that copies rasters into a new Geodatabase. I run print statements and everything is fine until I reach the arcpy.CopyRaster_management(raster, outraster). I am wondering if there is something wrong with the formatting of the file names. It throws a 999999 error. How long did it take you to really become comfortable in the Arcpy environment and with python in general. My goal is to build python based geoprocessing tools one day.
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">from</SPAN> arcpy <SPAN class="keyword token">import</SPAN> env
out_path <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:/EsriPress/Python/Data/Exercise09"</SPAN>
env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> out_path
rasterlist <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListRasters<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CreatePersonalGDB_management<SPAN class="punctuation token">(</SPAN>out_path <SPAN class="operator token">+</SPAN> <SPAN class="string token">"/Results"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"myrasters.gdb"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> raster <SPAN class="keyword token">in</SPAN> rasterlist<SPAN class="punctuation token">:</SPAN>
desc <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Describe<SPAN class="punctuation token">(</SPAN>raster<SPAN class="punctuation token">)</SPAN>
rname <SPAN class="operator token">=</SPAN> desc<SPAN class="punctuation token">.</SPAN>baseName
outraster <SPAN class="operator token">=</SPAN> out_path <SPAN class="operator token">+</SPAN> <SPAN class="string token">"/Results/myrasters.gdb/"</SPAN> <SPAN class="operator token">+</SPAN> rname
arcpy<SPAN class="punctuation token">.</SPAN>CopyRaster_management<SPAN class="punctuation token">(</SPAN>raster<SPAN class="punctuation token">,</SPAN> outraster<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>