sequence similarity matrix

Hello i was wondering if someone could help me in building a matrix like this:

(i have two sets of uniprot accession numberes from two different species)

   species   1
species 2
P08865P80404P32754P49189………
P16885
Q05823
O15528
Q02218
…….

i want to pull out all the fasta sequences using these accession numbers and do a pairwise comparison of each sequence of both the species. The matrix values are the sequence identity (or E values like in BLAST output)...

I would appreciate any help/comment from community members.

Thank you

nar