Mercurial > repos > jjohnson > sqlite_to_tabular
comparison sqlite_to_tabular.py @ 2:123b9ca5e26a draft default tip
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/sqlite_to_tabular commit ae4f3ee9048be3ebc9fa3bc0783e73ac31082899-dirty
| author | jjohnson |
|---|---|
| date | Thu, 02 Mar 2017 13:48:26 -0500 |
| parents | cf32fc695e72 |
| children |
comparison
equal
deleted
inserted
replaced
| 1:78e9570fbe08 | 2:123b9ca5e26a |
|---|---|
| 75 cur = conn.cursor() | 75 cur = conn.cursor() |
| 76 results = cur.execute(query) | 76 results = cur.execute(query) |
| 77 if not options.no_header: | 77 if not options.no_header: |
| 78 outputFile.write("#%s\n" % '\t'.join([str(col[0]) for col in cur.description])) | 78 outputFile.write("#%s\n" % '\t'.join([str(col[0]) for col in cur.description])) |
| 79 for i, row in enumerate(results): | 79 for i, row in enumerate(results): |
| 80 outputFile.write("%s\n" % '\t'.join([str(val) for val in row])) | 80 outputFile.write("%s\n" % '\t'.join([str(val) if val is not None else '' for val in row])) |
| 81 except Exception, exc: | 81 except Exception, exc: |
| 82 print >> sys.stderr, "Error: %s" % exc | 82 print >> sys.stderr, "Error: %s" % exc |
| 83 exit(1) | 83 exit(1) |
| 84 | 84 |
| 85 if __name__ == "__main__": | 85 if __name__ == "__main__": |
