Thread: zipfile script

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2015
    Posts
    6
    Rep Power
    0

    Lightbulb zipfile script


    Hello Community,

    Could someone please help me with what Im doing wrong please.

    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)
    Thankyou very much
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Location
    Joensuu, Finland
    Posts
    450
    Rep Power
    67
    I don’t know either of the modules you use, but I think if everything is as written, you should qualify the namespace on the last-but-one row; i.e., instead of “zip = ZipFile(targetzip)” you’d use “zip = zipfile.ZipFile(targetzip)”.
    My armada: openSUSE 13.2 (laptop), Debian GNU/Linux 8.0 (desktop, server), OpenELEC 5.0 (HTPC), Android 4.2.1 (tablet)

IMN logo majestic logo threadwatch logo seochat tools logo