擅长:python、mysql、java
<p>我有亚历克的密码。我做了一些小修改:(注意,这对受密码保护的zipfiles不起作用)</p>
<pre><code>import os
import sys
import zipfile
z = zipfile.ZipFile(sys.argv[1]) # Flexibility with regard to zipfile
for filename in z.namelist():
if not os.path.isdir(filename):
# read the file
for line in z.open(filename):
print line
z.close() # Close the file after opening it
del z # Cleanup (in case there's further work after this)
</code></pre>