Last active
October 20, 2016 14:12
-
-
Save gfreezy/11e4821d19e1f81ecdc4437123690ee0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
path = '/mfs/test/%d.xlsx' | |
def write(file_path): | |
from xlsxwriter import Workbook | |
wb = Workbook(file_path) | |
st = wb.add_worksheet('test') | |
for i in range(10): | |
st.write(i, i, 'aa') | |
wb.close() | |
total = 0 | |
success = 0 | |
for i in xrange(100): | |
write(path % i) | |
if 0 == subprocess.call(['unzip', '-t', path % i]): | |
success += 1 | |
total += 1 | |
print success, total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
python test.py > /dev/null