[Baypiggies] adding hyperlinks to output

Lincoln Peters anfrind at gmail.com
Wed Jan 12 20:58:43 CET 2011


On Wed, Jan 12, 2011 at 11:35 AM, Eric Walstad <eric at ericwalstad.com> wrote:
> Ah, looks like an Excel issue.  Googling for Excel hyperlink, I see it
> uses the 'hyperlink' function - have a look in the help file for that
> function for details, but this might get you close:
> writer.writerow(('hyperlink("http://www.ncbi.nlm.nih.gov/gene/9101",
> USP8)', 'bla'))

Another option that might work is to save the data as an HTML file
with just a table and whatever links you need.  If you can generate an
HTML file that looks like this:

<html>
<body>
<table>
<tr><td>Gene Link</td><td>Protein Link</td></tr>
<tr><td><a href="http://www.ncbi.nlm.nih.gov/gene/9101">USP8</a></td><td>bla</td></tr>
</table>
</body>
</html>

I know Excel 2007 can read it correctly (I just tested it), and it's
simple enough that it wouldn't be hard to generate from Python.  It
also has the advantage that someone who doesn't have Excel can still
read it just by loading it in a web browser.


-- 
Lincoln Peters
<anfrind at gmail.com>


More information about the Baypiggies mailing list