Script to Search

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • godsgift
    New Member
    • Feb 2008
    • 8

    Script to Search

    Hi,

    Iam New to python,My requirement is I want to create one python Script,
    this script should check one folder that folder contain many zip files ,our target is to check each zip files ,whether any test.exe files is there r not ,and we should store all file names of Zip where there is no test.exe.any idea about this ??????????????

    regards
    Moorthy.
  • dazzler
    New Member
    • Nov 2007
    • 75

    #2
    maybe zipfile module would be good way to start?
    http://docs.python.org/lib/zipfile-objects.html

    Comment

    • sakthivelvm
      New Member
      • Mar 2008
      • 2

      #3
      [HTML]def main():
      import os, glob, zipfile,re
      path = "C:\\my access point\\"
      for infile in glob.glob(os.pa th.join(path,'* .zip')):
      #print infile
      z = zipfile.ZipFile (infile, "r")
      for filename in z.namelist():
      if not (re.search(".ex e",filename,fla gs=0)):
      print z.filename


      if __name__ == '__main__':
      main()[/HTML]

      Comment

      Working...