Re: How to compress a folder and all of its sub directories and files into a zip file?
Hi, What about this: import os,zipfile from os.path import join zip = zipfile.ZipFile("myzipfile.zip", 'w') for root, dirs, files in os.walk('.'): for fileName in files: zip.write(join(root,fileName)) zip.close() Maybe it zips also the myzipfile.zip ;-) Probably this is not needed, so an additional test (something like fileName != 'myfile.zip' would be needed. HTH, Peter could ildg wrote: > I want to compress a folder and all of its sub files including empty folders > into a zip file. what's the pythonic way to do this? > > Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: Which IDE is recommended?
What about eric? (btw afaik it is not listed among the python.org editors, or have i overlooked it)? I have installed it today only, so do not kill me if it's crap, i am just asking ;-) however it looks promising... (at least after IDLE) I have been using PyDev for some time, but i think it is not always very handsome (e.g. writing a 5-line script in vim needs less time than eclipse startup ;-) otoh, for 5line scripts i am using vim anyway... monkey wrote: Read through python site for programming tool, really plenty of choices :-) (For c++, I just can't breath with very very limited choices) Tried Spe, it come with wxGlade built-in very nice(is Spe still actively develop?). But seem that Boa Constructor and PyDev(the plug-in for Eclipse) also worth looking. Actually which one are you guys using? and why? I think it is also valuable for those who are new to python as me. -- http://mail.python.org/mailman/listinfo/python-list