[Baypiggies] adding hyperlinks to output

Eric Walstad eric at ericwalstad.com
Wed Jan 12 20:35:25 CET 2011


Vikram,

On Wed, Jan 12, 2011 at 11:15 AM, Vikram K <kpguy1975 at gmail.com> wrote:
>
> thanks for your response. I tried using the anchor tag but Excel is not recognizing it as a hyperlink. This is my test script:
>
> import csv
> fout = open ('test.csv', 'w')
>
> writer = csv.writer(fout)
>
> writer.writerow(('Gene Link', 'Protein Link'))
>
> writer.writerow(('<a href="http://www.ncbi.nlm.nih.gov/gene/9101">USP8</a>', 'bla'))
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'))

Eric.


More information about the Baypiggies mailing list