Skip to content

Instantly share code, notes, and snippets.

@gfreezy
Last active October 20, 2016 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gfreezy/11e4821d19e1f81ecdc4437123690ee0 to your computer and use it in GitHub Desktop.
Save gfreezy/11e4821d19e1f81ecdc4437123690ee0 to your computer and use it in GitHub Desktop.
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
@gfreezy
Copy link
Author

gfreezy commented Oct 20, 2016

python test.py > /dev/null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment