<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script for Making Individual Zip file for Each Shapefile? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363216#M28713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The list functions don't return lists if your geoprocessor is set above 9.3. To make it run in 9.3 mode, do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;gp = arcgisscripting.create(9.3)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will ensure the same behavior of this script even in 10.0/10.1. Then, use this idiom:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;for shape in iter(shapes.next, None):&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since it returns a geoprocessing list object and not a Python list in 9.3.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 May 2013 21:56:25 GMT</pubDate>
    <dc:creator>JasonScheirer</dc:creator>
    <dc:date>2013-05-30T21:56:25Z</dc:date>
    <item>
      <title>Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363209#M28706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I posted this in the Geoprocessing forum and then I thought I should post it here - sorry if this is redundant.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to take all of the shapefiles in a directory and compress them into &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;individual &lt;/SPAN&gt;&lt;SPAN&gt;zip files. I need to take, for example, the roads shapefile and get all of the files named roads.* into roads.zip, the schools shapefile, schools.* into schools.zip, and so on, for hundreds of shapefiles.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 12:47:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363209#M28706</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2013-05-29T12:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363210#M28707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This worked for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os
from os import path as p
import zipfile
arcpy.overwriteOutput = True


def ZipShapes(path, out_path):
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = path
&amp;nbsp;&amp;nbsp;&amp;nbsp; shapes = arcpy.ListFeatureClasses()

&amp;nbsp;&amp;nbsp;&amp;nbsp; # iterate through list of shapefiles
&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in shapes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = p.splitext(shape)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip_path = p.join(out_path, name + '.zip')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip = zipfile.ZipFile(zip_path, 'w')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,shape), shape)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in arcpy.ListFiles('%s*' %name):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not f.endswith('.shp'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,f), f)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'All files written to %s' %zip_path
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.close()

if __name__ == '__main__':

&amp;nbsp;&amp;nbsp;&amp;nbsp; path = r'C:\Shape_test\Census_CedarCo'
&amp;nbsp;&amp;nbsp;&amp;nbsp; outpath = r'C:\Shape_outputs'

&amp;nbsp;&amp;nbsp;&amp;nbsp; ZipShapes(path, outpath)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just fill in your own variables for the ones highlighted in red. The "path" variable is the workspace containing all shapefiles to be zipped. The "outpath" variable is the output location for all your zipped folders for each shapefile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: I added an additional part to get rid of the subfolders created in the zip (the arcname argument for the zip.write).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363210#M28707</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T16:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363211#M28708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Caleb, that worked!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One thing I noticed, though is that it did not actually compress the files (they were archived in zip files but not compressed). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed a line&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip = zipfile.ZipFile(zip_path, 'w')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip = zipfile.ZipFile(zip_path, 'w',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compression=zipfile.ZIP_DEFLATED)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and now the zipped files are compressed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jacob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 17:53:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363211#M28708</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2013-05-29T17:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363212#M28709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;One thing I noticed, though is that it did not actually compress the files (they were archived in zip files but not compressed). &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ahh, good eye!&amp;nbsp; I did not realize that they were not getting compressed.&amp;nbsp; I suppose I just assumed that automatically happened when writing the zip files.&amp;nbsp; That's good to know. Glad it did the trick tho!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 18:07:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363212#M28709</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-05-29T18:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363213#M28710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So the script above works perfectly, with ArcGIS 10. But I just realized that it has to run in ArcGIS 9.3.1 instead! I tried importing arcgisscripting instead of arcpy and changed code from, for example, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shapes = arcpy.ListFeatureClasses() &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shapes = gp.ListFeatureClasses() &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but I get errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems like it does not know what the workspace is, so at least the first error is in here where the workspace is defined:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;def ZipShapes(path, out_path):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.env.workspace = path&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shapes = gp.ListFeatureClasses()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate any suggestions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 20:29:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363213#M28710</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2013-05-30T20:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363214#M28711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Set gp.workspace, not gp.env.workspace&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 21:12:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363214#M28711</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2013-05-30T21:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363215#M28712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried gp.workspace = path and I get a "object is not iterable" error. Below is my attempt at 9.3.1 code and below that is the error. I am sure someone will see something obvious that I am missing. Edit: Here the indents are missing - the indents don't show up when I pasted the code here but you get the idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Begin code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import sys, string, arcgisscripting, os&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from os import path as p&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import zipfile&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Create the Geoprocessor object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp = arcgisscripting.create()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# arcpy.overwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.overwriteoutput=1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def ZipShapes(path, out_path):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.workspace = path&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shapes = gp.ListFeatureClasses()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # iterate through list of shapefiles&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in shapes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = p.splitext(shape)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip_path = p.join(out_path, name + '.zip')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip = zipfile.ZipFile(zip_path, 'w',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compression=zipfile.ZIP_DEFLATED)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,shape), shape)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in gp.ListFiles('%s*' %name):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not f.endswith('.shp'):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,f), f)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'All files written to %s' %zip_path&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.close()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if __name__ == '__main__':&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = r'T:\\cotiss\\CobleJ\\shape2zip\\address'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outpath = r'T:\\cotiss\\CobleJ\\shape2zip\\Shape_outputs'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZipShapes(path, outpath)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#End of code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HERE is the ERROR:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "T:\cotiss\CobleJ\shape2zip\Shape2Zip_931.py", line 34, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZipShapes(path, outpath)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "T:\cotiss\CobleJ\shape2zip\Shape2Zip_931.py", line 16, in ZipShapes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in shapes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeError: 'geoprocessing list object' object is not iterable&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 21:22:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363215#M28712</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2013-05-30T21:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363216#M28713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The list functions don't return lists if your geoprocessor is set above 9.3. To make it run in 9.3 mode, do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;gp = arcgisscripting.create(9.3)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will ensure the same behavior of this script even in 10.0/10.1. Then, use this idiom:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;for shape in iter(shapes.next, None):&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since it returns a geoprocessing list object and not a Python list in 9.3.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 21:56:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363216#M28713</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2013-05-30T21:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363217#M28714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think ListFiles is recognized in 9.3.1. I seem to have a problem with that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 14:29:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363217#M28714</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2013-05-31T14:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363218#M28715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use the os.walk() and fnmatch to get the file names:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import fnmatch, os

for shape in shapes:
&amp;nbsp;&amp;nbsp;&amp;nbsp; name = p.splitext(shape)[0]:
&amp;nbsp;&amp;nbsp;&amp;nbsp; zip_path = p.join(out_path, name + '.zip')
&amp;nbsp;&amp;nbsp;&amp;nbsp; zip = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,shape), shape)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for path, dirs, files in os.walk(path):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in files:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fnmatch.fnmatch(f, '%s*' %shape):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,f), f)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'All files written to %s' %zip_path
&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.close()

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By using fnmatch you can provide a pattern for it to search for when looking through files so if your shapefile name is roads.shp, it can search all files that are like 'roads*'.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:23:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363218#M28715</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T16:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363219#M28716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry to keep bugging the forum about this. I get the error, "NameError: global name 'zipflie' is not defined". And I am running this in ArcGIS 9.3.1. Unfortunately our shop is still using 9.3.1 on some machines and 10.0 on others so I have to support some scripts for both.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import sys, os, string, arcgisscripting, fnmatch
from os import path as p
import zipfile

# Create the Geoprocessor object
gp = arcgisscripting.create()

# arcpy.overwriteOutput = True
gp.overwriteoutput=1

def ZipShapes(path, out_path):
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.workspace = path
&amp;nbsp;&amp;nbsp;&amp;nbsp; shapes = gp.ListFeatureClasses("*")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # iterate through list of shapefiles
&amp;nbsp;&amp;nbsp;&amp;nbsp; #for shape in shapes:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in iter(shapes.next, None):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = p.splitext(shape)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip_path = p.join(out_path, name + '.zip')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip = zipfile.ZipFile(zip_path, 'w', zipflie.ZIP_DELFLATED)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for path, dirs, files in os.walk(path):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in files:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fnmatch.fnmatch(f, '%s*' %shape):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,f), f)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'All files written to %s' %zip_path
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.close()

if __name__ == '__main__':

&amp;nbsp;&amp;nbsp;&amp;nbsp; path = r'T:\\cotiss\\CobleJ\\shape2zip\\address'
&amp;nbsp;&amp;nbsp;&amp;nbsp; outpath = r'T:\\cotiss\\CobleJ\\shape2zip\\Shape_outputs'

&amp;nbsp;&amp;nbsp;&amp;nbsp; ZipShapes(path, outpath)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:55:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363219#M28716</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2021-12-11T16:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363220#M28717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I get the error, "NameError: global name 'zipflie' is not defined".&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apparently you mistyped 'zipflie.ZIP_DEFLATED' when it was supposed to be zipfile.ZIP_DEFLATED. Fix this line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
zip = zipfile.ZipFile(zip_path, 'w', &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;zipfile&lt;/SPAN&gt;.ZIP_DELFLATED)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:55:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363220#M28717</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T16:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363221#M28718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, it's very close! Just one problem. It will only make one complete zip file out of the first shapefile in my source directory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suppose my folder has four shapefiles (this is the folder called "address"). Let's say the shapefiles are named parcels.* and parcel_join.* and pointaddr.* and zipcodes.* - in my output folder "Shape_outputs" there will be four zip files. The first zip file of the first shapefile (parcels.zip will be okay, it has all of the files making up the parcels shapefile). The next two zip files will be empty. The last zip file, zipcodes.zip, will only contain one file from the zipcodes shapefile - it has the zipcodes.shp file but not the zipcodes.dbf, .sbn, .sbx, etc. It takes a few seconds to make the first zip file judging from the message it prints, then in a flash it prints the names of the other three files and the script stops without an error message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import sys, os, string, arcgisscripting, fnmatch
from os import path as p
import zipfile

# Create the Geoprocessor object
gp = arcgisscripting.create()

# arcpy.overwriteOutput = True
gp.overwriteoutput=1

def ZipShapes(path, out_path):
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.workspace = path
&amp;nbsp;&amp;nbsp;&amp;nbsp; shapes = gp.ListFeatureClasses("*")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # iterate through list of shapefiles
&amp;nbsp;&amp;nbsp;&amp;nbsp; #for shape in shapes:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in iter(shapes.next, None):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = p.splitext(shape)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip_path = p.join(out_path, name + '.zip')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for path, dirs, files in os.walk(path):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in files:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fnmatch.fnmatch(f, '%s*' %shape):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,f), f)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'All files written to %s' %zip_path
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.close()

if __name__ == '__main__':

&amp;nbsp;&amp;nbsp;&amp;nbsp; path = r'T:\\cotiss\CobleJ\shape2zip\address'
&amp;nbsp;&amp;nbsp;&amp;nbsp; outpath = r'T:\\cotiss\CobleJ\shape2zip\Shape_outputs'

&amp;nbsp;&amp;nbsp;&amp;nbsp; ZipShapes(path, outpath)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:55:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363221#M28718</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2021-12-11T16:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363222#M28719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, I think I got it now. I cannot test on 9.3 but this did work on 10.1 with arcgisscripting. I went with the glob method instead and it got all the files:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcgisscripting, os, glob, zipfile
from os import path as p

# Create the Geoprocessor object
gp = arcgisscripting.create()

# arcpy.overwriteOutput = True
gp.overwriteoutput=1

def ZipShapes(path, out_path):
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.workspace = path
&amp;nbsp;&amp;nbsp;&amp;nbsp; shapes = gp.ListFeatureClasses("*")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # iterate through list of shapefile
&amp;nbsp;&amp;nbsp;&amp;nbsp; for shape in iter(shapes.next, None):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = p.splitext(shape)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip_path = p.join(out_path, name + '.zip')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.chdir(path)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for files in glob.glob('%s*' %name):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.write(p.join(path,files), files)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'All files written to %s' %zip_path
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zip.close()

if __name__ == '__main__':

&amp;nbsp;&amp;nbsp;&amp;nbsp; path = r'T:\\cotiss\CobleJ\shape2zip\address'
&amp;nbsp;&amp;nbsp;&amp;nbsp; outpath = r'T:\\cotiss\CobleJ\shape2zip\Shape_outputs'

&amp;nbsp;&amp;nbsp;&amp;nbsp; ZipShapes(path, outpath)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363222#M28719</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T16:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363223#M28720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb, thanks for your help! There is just one more quirk. If I have shapefiles with similar names, it will make one zip file for each shapefile but the zip files will have all of the shapefiles with similar names instead of just the shapefile with the exact name. I have two shapefiles, called "parcel" and "ParcelAd" and it makes two zip files with both names. But if I open parcel.zip it has everything for both parcel.* and ParcelAd.* and if I open ParcelAd.zip it will have everything for both parcel.* and ParcelAd.*&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jun 2013 04:25:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363223#M28720</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2013-06-02T04:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363224#M28721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;...minor clarification on this line I think will fix your problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
for files in glob.glob('%s.*' %name):
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For this minor but annoying quirk, you almost answered your own question when you said "...it has everything for both parcel.*..." --- notice you inserted the period. Well you have to do the same in the code. If you leave off the period it not only 'globs' the component files making up your shapefile but if other shapefiles contain the same root name i.e. root + file ext or root + suffix + file ext, then both sets of file components are returned -- in other words, the wildcard allows it. So to 'tighten' the wildcard filter you need the period. Also, careful with the xml component file...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Powerful subtlety... I've stumbled on this as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363224#M28721</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-12T16:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Making Individual Zip file for Each Shapefile?</title>
      <link>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363225#M28722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Success! Thanks so much Caleb, Jason and Wayne. I ran both the 10.0 and the 9.3.1 scripts and everything is fine - they no longer get "confused" by files with similar names, and it makes sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So on the 9.3.1 script the line should be&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for files in glob.glob('%s.*' %name):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and in the 10.0 script the equivalent line should be&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in arcpy.ListFiles('%s.*' %name):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jun 2013 22:54:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-for-making-individual-zip-file-for-each/m-p/363225#M28722</guid>
      <dc:creator>JacobCoble</dc:creator>
      <dc:date>2013-06-02T22:54:16Z</dc:date>
    </item>
  </channel>
</rss>

