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

Popular posts from this blog

python - TypeError: start must be a integer -

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

html - href attribute breaking an element -