view create_html.py @ 4:ee3d71cb8dc8 draft

Uploaded
author bernhardlutz
date Tue, 31 Dec 2013 06:59:39 -0500
parents 4699a84c41d8
children
line wrap: on
line source

#!/usr/bin/env python

import os
import sys
import zipfile


os.chdir(sys.argv[2])
o = open( 'results.html', 'w+' )


o.write('<html> <body> <h1> ExpaRNA Result </h1>' )

for filename in os.listdir( sys.argv[2] ):
    if os.path.isfile( os.path.join( sys.argv[2], filename) ) and False ==(filename.endswith('epm') or filename.endswith('fa') or filename.endswith('aln') or filename.endswith('html')):
        o.write( '<img src="%s" /><br />' % ( filename ))

o.write( '</body></html>' )
o.close()

# create zip file

zf = zipfile.ZipFile(sys.argv[1], mode='w')
for files in os.listdir(sys.argv[2]):
        zf.write(files)
zf.close()