Here is my fully working and tested code..
Thanks to you all for your assistance!
if "/" in afile:
aZipFile = afile.rsplit('/', 1)[-1] # Split file based on criteria.
outfile = open(aZipFile, 'w') # Open output buffer for writing.
outfile.write(zfile.read(afile)) # Write the file.
outfile.close () # Close the output file buffer.
elif "\\" in afile:
aZipFile = afile.rsplit('\\', 1)[-1] # Split file based on criteria.
outfile = open(aZipFile, 'w') # Open output buffer for writing.
outfile.write(zfile.read(afile)) # Write the file.
outfile.close() # Close the output file buffer.
else:
outfile = open(afile, 'w') # Open output buffer for writing.
outfile.write(zfile.read(afile)) # Write the file.
outfile.close() # Close the output file buffer.
On 10/15/06, Kent Johnson <
[EMAIL PROTECTED]> wrote:
Chris Hengge wrote:
> I must have not been clear.. I have a zip file with folders inside..
> When I extract it.. I dont want the folder structure, just the files..
>
> using split doesn't seem to help in this situation.. unless I'm not
> putting the results in the right spot..
Can you show us what you tried? split() can definitely help here.
Kent
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor