Mercurial > repos > greg > gene_family_classifier
comparison gene_family_classifier.py @ 106:a2a3593a42d4 draft
Uploaded
author | greg |
---|---|
date | Mon, 27 Feb 2017 13:00:25 -0500 |
parents | 8abf3c06e7e1 |
children | bdb3929a4d09 |
comparison
equal
deleted
inserted
replaced
105:8abf3c06e7e1 | 106:a2a3593a42d4 |
---|---|
82 sys.stderr.write(msg) | 82 sys.stderr.write(msg) |
83 sys.exit(1) | 83 sys.exit(1) |
84 | 84 |
85 | 85 |
86 def write_html_output(output, title, dir): | 86 def write_html_output(output, title, dir): |
87 fh = open(output, 'wb') | 87 with open(output, 'wb') as fh: |
88 fh.write('<html><head><title>%s</title></head><body><p/><ul>' % str(title)) | 88 fh.write('<html><head><title>%s</title></head><body><p/><ul>\n' % title) |
89 for fname in os.listdir(dir): | 89 for fname in os.listdir(dir): |
90 fh.write('<li><a href="%s">%s</a></li>' % (fname, fname)) | 90 fh.write('<li><a href="%s">%s</a></li>\n' % (fname, fname)) |
91 fh.write('</ul></body></html>') | 91 fh.write('</ul></body></html>\n') |
92 fh.close() | |
93 | 92 |
94 | 93 |
95 # Define command response buffers. | 94 # Define command response buffers. |
96 tmp_out = tempfile.NamedTemporaryFile().name | 95 tmp_out = tempfile.NamedTemporaryFile().name |
97 tmp_stdout = open(tmp_out, 'wb') | 96 tmp_stdout = open(tmp_out, 'wb') |