Mercurial > repos > iuc > sqlite_to_tabular
diff query_db.py @ 1:c1b700bc0150 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 81f69ad5f39223059c40501e55ac777d3feca845
author | iuc |
---|---|
date | Fri, 18 Aug 2017 16:48:20 -0400 |
parents | 859064f07be4 |
children | 6e72fd26a9d3 |
line wrap: on
line diff
--- a/query_db.py Tue Jul 18 09:07:26 2017 -0400 +++ b/query_db.py Fri Aug 18 16:48:20 2017 -0400 @@ -56,12 +56,12 @@ exit(0) -def run_query(conn, query, outputFile, no_header=False): +def run_query(conn, query, outputFile, no_header=False, comment_char='#'): cur = conn.cursor() results = cur.execute(query) if not no_header: - outputFile.write("#%s\n" % '\t'.join( - [str(col[0]) for col in cur.description])) + outputFile.write("%s%s\n" % (comment_char, '\t'.join( + [str(col[0]) for col in cur.description]))) for i, row in enumerate(results): outputFile.write("%s\n" % '\t'.join( [str(val) if val is not None else '' for val in row]))