python - A simple Script to extracting a zip file -
good evening all,
i think i'm not understanding zipfile structure heres code
import xbmc import zipfile targetzip = xbmc.translatepath('special://home/userdata/addon_data/plugin.program.tester/test.zip') extractto = xbmc.translatepath('special://home/userdata/addon_data/plugin.program.tester/') zip = zipfile(targetzip) zip.extractall(extractto)
any ideas why not working?
try way
import zipfile fh = open(targetzip, 'rb') z = zipfile.zipfile(fh) name in z.namelist(): z.extract(name, extractto) fh.close()
Comments
Post a Comment