i want ignore path of file stored in zip. use following:
zipfile.extract('/ignorepath/filename.txt', '/mygoodpath')
this create followng:
/mygoodpath/ignorepath/filename.txt
i prefer
/mygoodpath/filename.txt
i looking @ shutil.move zipfile.open open , write, though later have few edge cases. best method handle this?
try using zipfile.open
with zipfile('spam.zip') myzip: myzip.open('/ignorepath/filename.txt') infile: open('/mygoodpath/filename.txt', 'w') outfile: outfile.write(infile.read())
Comments
Post a Comment