I'm wondering how to have a single parameter in the arcpy.FeatureClassToFeatureClass_conversion() function instead of repeating the block of code for two variables (Address_Points and Street), basically.
From what I understand, the way this script is set up now, the outer loop prints once for each variable. Then it prints once for each variable again in the inner loop. It runs as I expect, namely with no errors and saves the two feature classes as shapefiles in the Test folder.
<SPAN class="keyword token">import</SPAN> arcpy
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>overwriteOutput <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
<SPAN class="comment token"># variables</SPAN>
infeatures <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>r<SPAN class="string token">'fullpath\gisedit.DBO.Street'</SPAN><SPAN class="punctuation token">,</SPAN>
r<SPAN class="string token">'fullpath\gisedit.DBO.Address_Points'</SPAN><SPAN class="punctuation token">]</SPAN>
outpath <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'fullpath\GISstaff\Jared\Test'</SPAN>
outfeatures <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'WillCounty_Streets'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'WillCounty_AddressPoints'</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token"># loop and print feature classes</SPAN>
<SPAN class="keyword token">for</SPAN> infs <SPAN class="keyword token">in</SPAN> infeatures<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> infs
<SPAN class="keyword token">for</SPAN> otfs <SPAN class="keyword token">in</SPAN> outfeatures<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> otfs
arcpy<SPAN class="punctuation token">.</SPAN>FeatureClassToFeatureClass_conversion<SPAN class="punctuation token">(</SPAN>infs<SPAN class="punctuation token">,</SPAN>outpath<SPAN class="punctuation token">,</SPAN>otfs<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></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Result:
<SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> fullpath\gisedit<SPAN class="punctuation token">.</SPAN>DBO<SPAN class="punctuation token">.</SPAN>Street
WillCounty_Streets
WillCounty_AddressPoints
fullpath\gisedit<SPAN class="punctuation token">.</SPAN>DBO<SPAN class="punctuation token">.</SPAN>Address_Points
WillCounty_Streets
WillCounty_AddressPoints<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
How do I get the print out to look like this?
WillCounty_Streets
WillCounty_AddressPoints<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>