Mercurial > repos > jjohnson > query_tabular
comparison query_tabular.py @ 10:e84d1c3bf4fe draft
Uploaded
author | jjohnson |
---|---|
date | Thu, 02 Mar 2017 13:43:25 -0500 |
parents | 0ed75ed20c7e |
children | fd16243931d6 |
comparison
equal
deleted
inserted
replaced
9:0ed75ed20c7e | 10:e84d1c3bf4fe |
---|---|
360 if not options.no_header: | 360 if not options.no_header: |
361 outputFile.write("#%s\n" % '\t'.join([str(col[0]) for col in cur.description])) | 361 outputFile.write("#%s\n" % '\t'.join([str(col[0]) for col in cur.description])) |
362 # yield [col[0] for col in cur.description] | 362 # yield [col[0] for col in cur.description] |
363 for i, row in enumerate(results): | 363 for i, row in enumerate(results): |
364 # yield [val for val in row] | 364 # yield [val for val in row] |
365 outputFile.write("%s\n" % '\t'.join([str(val) for val in row])) | 365 outputFile.write("%s\n" % '\t'.join([str(val) if val is not None else '' for val in row])) |
366 except Exception, exc: | 366 except Exception, exc: |
367 print >> sys.stderr, "Error: %s" % exc | 367 print >> sys.stderr, "Error: %s" % exc |
368 exit(1) | 368 exit(1) |
369 | 369 |
370 if __name__ == "__main__": | 370 if __name__ == "__main__": |