with zipfile.ZipFile(tDir + mainapk[0]) as z:
    with open(os.path.join(tDir, os.path.basename(icon[1])), 'wb') as f:
        pass
Extract a specific file from a zip archive without maintaining directory structure in python