[Tutor] Unzipping a Zip of folders that have zips within them that I'd like to unzip all at once.

Gregory Lund gnj091405 at gmail.com
Wed Sep 19 20:09:38 CEST 2012


On Wed, Sep 19, 2012 at 10:40 AM, Peter Otten <__peter__ at web.de> wrote:
> Steven D'Aprano wrote:
>
>> That's what we're here for! Don't be shy about asking questions.
>
> Indeed. Also, Gregory, don't expect anything to work directly. Programming
> is mostly an iterative process where you write just a little bit of code
> before you have to stop to fix a host of bugs. Repeat until you have
> something that almost does what you intended...

Believe me, I don't expect it to work directly, that's for sure.
I have just that, a little bit of code that extracts the first zip,
and am now working on a little bit of code to extract the zips within
it.
>
>> However, I have to say Peter was a bit optimistic in his assumptions about
>> your general level of expertise. He mixed Python code and (probably) Linux
>> shell commands and output, which probably didn't help.
>
> Gregory introduced himself as a university lecturer, so I tacitly assumed
> that he had seen a shell window on a linux box or a mac, and would
> appreciate if he could use something familiar (globbing) in a new
> environment (python).

You were correct, I have seen a shell window on a Windows box. Correct
Assumption.
However, I did not know it was that, to which you were referencing,
and it wouldn't of worked where I want it to:
In a GUI via ArcGIS.
>
> I make similar assumptions about questioners' skills level all the time --
> and sometimes fail in a big way ;)
Sorry, tried to emphasize the 'neophyte' from the get go.
Definition of crazy? Doing the same thing over and over again while
expecting different results?

Perhaps the code can not be written to run in a python shell (from
which I could use in my Esri ArcGIS GUI.
(again, I have a spot to put in one link to the .py code, the GUI asks
me (in a way) "which zipfile", I navigate to it and click <OK>
I have no need for shortened code or running in the cmd window, it's
such a short operation, it doesn't matter if it takes me 100 to 1000
lines of 'baby' or 'rookie' code to write, as long as it works.
With only one starting zip and within it up to 40 folders each
containing (usually) one zipfile (max of 5), the matter of time it
takes to run is not an issue.
I just need to have one .py file that does it all, or calls upon other
.py files I guess in order to work.

I do appreciate the help, and am learning in this process.
again, maybe I want python to do something that can't be done?

Greg


More information about the Tutor mailing list