E D R S I H C RSS
ID
Password
Join
You will be given a post of trust and responsibility.

FrontPage ZIP압축

#-*- coding: cp949 -*- 
# 파일 명을 받아서 압축해 주는 스크립트

import os
import sys
import glob
import zipfile


def main(files):
    file_number = len(files)
    target_file = files[1];
         
    target = zipfile.ZipFile(target_file, 'w')
 
    for idx in range (2, file_number):
        all_flist = glob.glob (files[idx])
        for f in all_flist:
            if os.path.isdir(f):
                pass
            target.write(f)
    
    target.close()
   

#-------------------------------------------------------------------------------
# main
if __name__ == "__main__":  
    if len(sys.argv) < 3:
        print "Usage : pyzip source1 [source2]*"
    else:
        main(sys.argv)
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2010-10-25 00:27:17
Processing time 0.0247 sec