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):
    gp.workspace = path
    shapes = gp.ListFeatureClasses("*")
    # iterate through list of shapefiles
    #for shape in shapes:
    for shape in iter(shapes.next, None):
        name = p.splitext(shape)[0]
        print name
        zip_path = p.join(out_path, name + '.zip')
        zip = zipfile.ZipFile(zip_path, 'w', zipflie.ZIP_DELFLATED)
        for path, dirs, files in os.walk(path):
            for f in files:
                if fnmatch.fnmatch(f, '%s*' %shape):
                    zip.write(p.join(path,f), f)
        print 'All files written to %s' %zip_path
        zip.close()
if __name__ == '__main__':
    path = r'T:\\cotiss\\CobleJ\\shape2zip\\address'
    outpath = r'T:\\cotiss\\CobleJ\\shape2zip\\Shape_outputs'
    ZipShapes(path, outpath)
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		 
					
				
		
I get the error, "NameError: global name 'zipflie' is not defined".
zip = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DELFLATED)
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		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):
    gp.workspace = path
    shapes = gp.ListFeatureClasses("*")
    # iterate through list of shapefiles
    #for shape in shapes:
    for shape in iter(shapes.next, None):
        name = p.splitext(shape)[0]
        print name
        zip_path = p.join(out_path, name + '.zip')
        zip = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
        for path, dirs, files in os.walk(path):
            for f in files:
                if fnmatch.fnmatch(f, '%s*' %shape):
                    zip.write(p.join(path,f), f)
        print 'All files written to %s' %zip_path
        zip.close()
if __name__ == '__main__':
    path = r'T:\\cotiss\CobleJ\shape2zip\address'
    outpath = r'T:\\cotiss\CobleJ\shape2zip\Shape_outputs'
    ZipShapes(path, outpath)
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		 
					
				
		
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):
    gp.workspace = path
    shapes = gp.ListFeatureClasses("*")
    # iterate through list of shapefile
    for shape in iter(shapes.next, None):
        name = p.splitext(shape)[0]
        print name
        zip_path = p.join(out_path, name + '.zip')
        zip = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
        os.chdir(path)
        for files in glob.glob('%s*' %name):
            zip.write(p.join(path,files), files)
        print 'All files written to %s' %zip_path
        zip.close()
if __name__ == '__main__':
    path = r'T:\\cotiss\CobleJ\shape2zip\address'
    outpath = r'T:\\cotiss\CobleJ\shape2zip\Shape_outputs'
    ZipShapes(path, outpath)
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
for files in glob.glob('%s.*' %name):
