Hey all,
I have been searching online for ways to copy a zip file to a destination
and extract the zip file with python.
Currently nothing works due to my limited understanding.
I am wondering if my syntax is wrong or am I missing anything?
the code is as such. also if there is a better code, I am definitely open to
it. If it is good, can you also explain steps?
###########
import shutil, zipfile
shutil.copyfile('C:\Users\blueman\Desktop\myTest1.0.zip',
'C:\Users\blueman\Desktop\allFiles')
zipfilepath='C:\Users\blueman\Desktop\allFiles\myTest1.0.zip'
extractiondir='C:\Users\blueman\Desktop\allFiles\test'
def extract(zipfilepath, extractiondir):
zip = zipfile(zipfilepath)
zip.extractall(path=extractiondir)
print 'it works'
extract()
###########
thank you so much for your time and help in advance!!!
,
Marcus
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor