changeset 106:a2a3593a42d4 draft

Uploaded
author greg
date Mon, 27 Feb 2017 13:00:25 -0500
parents 8abf3c06e7e1
children bdb3929a4d09
files gene_family_classifier.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gene_family_classifier.py	Mon Feb 27 12:52:58 2017 -0500
+++ b/gene_family_classifier.py	Mon Feb 27 13:00:25 2017 -0500
@@ -84,12 +84,11 @@
 
 
 def write_html_output(output, title, dir):
-    fh = open(output, 'wb')
-    fh.write('<html><head><title>%s</title></head><body><p/><ul>' % str(title))
-    for fname in os.listdir(dir):
-        fh.write('<li><a href="%s">%s</a></li>' % (fname, fname))
-    fh.write('</ul></body></html>')
-    fh.close()
+    with open(output, 'wb') as fh:
+        fh.write('<html><head><title>%s</title></head><body><p/><ul>\n' % title)
+        for fname in os.listdir(dir):
+            fh.write('<li><a href="%s">%s</a></li>\n' % (fname, fname))
+        fh.write('</ul></body></html>\n')
 
 
 # Define command response buffers.