Python(命令行)

292 阅读1分钟
import optparse

option = optparse.OptionParser()
option.add_option("-z", dest="zipfile", type="string", help="The is a Zip FileName")
option.add_option("-d", dest="zipdiction", type="string", help="The is a Zip Diction")
(options, args) = option.parse_args()
if (options.zipfile == None) | (options.zipdiction == None):
    print "参数不匹配"
    exit(0)
else:
    # 需要压缩的zip路径
    targetPath = options.zipfile
    # # 破解的字典路径
    dictionPath = options.zipdiction