<br><br><div class="gmail_quote">On 24 September 2012 02:34, Oscar Benjamin <span dir="ltr"><<a href="mailto:oscar.j.benjamin@gmail.com" target="_blank">oscar.j.benjamin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im">On 24 September 2012 02:22, Gregory Lund <span dir="ltr"><<a href="mailto:gnj091405@gmail.com" target="_blank">gnj091405@gmail.com</a>></span> wrote:<div> </div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<div>
> You're trying to open the directory as if it were a zipfile. You should<br>
> pass in the path to a zipfile not to a folder.<br>
<br>
</div>Agreed, but how do I do that "pass in the path to a zipfile'?<br>
Using an if statement I presume?</div><div>
<br>
> ><div class="im"><br>
> > I guess my first issue is to resolve the 'Permission denied' problem.<br>
> > And, I know I need an 'if' statement, somehow...<br>
><br>
</div></div><div class="im">Yes, the permission denied problem seems to be the first real<br>
obstacle, but I can't figure it out.<br>
I tried searching online but everything I found to try, didn't work.<br></div></blockquote><div><br></div><div>The permission error is because you are trying to open a folder as if it were a file. The operating system does not give you permission to do this because it is a nonsensical operation. </div>
<div class="im">
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>> Remove the folder paths from the list of paths.<br>
<br>
</div>How can I remove the folder paths from the list of paths?<br></blockquote><div><br></div></div><div>You can do it with a list comprehension:</div><div><br></div><div>import os.path</div><div>paths = [p for p in paths if os.path.isdir(p)] </div>
</div></blockquote><div><br></div><div>Sorry that should be (note the 'not'):</div><div>paths = [p for p in paths if not os.path.isdir(p)] </div><div> </div><div>Oscar</div></div><br>