\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{Entrez}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Entrez}\PYG{o}{.}\PYG{n}{email} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}A.N.Other@example.com\PYGZdq{}}  \PYG{c+c1}{\PYGZsh{} Always tell NCBI who you are}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{handle} \PYG{o}{=} \PYG{n+nb}{open}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}Homo\PYGZus{}sapiens.xml\PYGZdq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{records} \PYG{o}{=} \PYG{n}{Entrez}\PYG{o}{.}\PYG{n}{parse}\PYG{p}{(}\PYG{n}{handle}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k}{for} \PYG{n}{record} \PYG{o+ow}{in} \PYG{n}{records}\PYG{p}{:}
\PYG{g+gp}{... }    \PYG{n}{status} \PYG{o}{=} \PYG{n}{record}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}Entrezgene\PYGZus{}track\PYGZhy{}info\PYGZdq{}}\PYG{p}{][}\PYG{l+s+s2}{\PYGZdq{}Gene\PYGZhy{}track\PYGZdq{}}\PYG{p}{][}\PYG{l+s+s2}{\PYGZdq{}Gene\PYGZhy{}track\PYGZus{}status\PYGZdq{}}\PYG{p}{]}
\PYG{g+gp}{... }    \PYG{k}{if} \PYG{n}{status}\PYG{o}{.}\PYG{n}{attributes}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}value\PYGZdq{}}\PYG{p}{]}\PYG{o}{==}\PYG{l+s+s2}{\PYGZdq{}discontinued\PYGZdq{}}\PYG{p}{:}
\PYG{g+gp}{... }        \PYG{k}{continue}
\PYG{g+gp}{... }    \PYG{n}{geneid} \PYG{o}{=} \PYG{n}{record}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}Entrezgene\PYGZus{}track\PYGZhy{}info\PYGZdq{}}\PYG{p}{][}\PYG{l+s+s2}{\PYGZdq{}Gene\PYGZhy{}track\PYGZdq{}}\PYG{p}{][}\PYG{l+s+s2}{\PYGZdq{}Gene\PYGZhy{}track\PYGZus{}geneid\PYGZdq{}}\PYG{p}{]}
\PYG{g+gp}{... }    \PYG{n}{genename} \PYG{o}{=} \PYG{n}{record}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}Entrezgene\PYGZus{}gene\PYGZdq{}}\PYG{p}{][}\PYG{l+s+s2}{\PYGZdq{}Gene\PYGZhy{}ref\PYGZdq{}}\PYG{p}{][}\PYG{l+s+s2}{\PYGZdq{}Gene\PYGZhy{}ref\PYGZus{}locus\PYGZdq{}}\PYG{p}{]}
\PYG{g+gp}{... }    \PYG{k}{print}\PYG{p}{(}\PYG{n}{geneid}\PYG{p}{,} \PYG{n}{genename}\PYG{p}{)}
\PYG{g+gp}{...}
\PYG{g+go}{1 A1BG}
\PYG{g+go}{2 A2M}
\PYG{g+go}{3 A2MP}
\PYG{g+go}{8 AA}
\PYG{g+go}{9 NAT1}
\PYG{g+go}{10 NAT2}
\PYG{g+go}{11 AACP}
\PYG{g+go}{12 SERPINA3}
\PYG{g+go}{13 AADAC}
\PYG{g+go}{14 AAMP}
\PYG{g+go}{15 AANAT}
\PYG{g+go}{16 AARS}
\PYG{g+go}{17 AAVS1}
\PYG{g+gp}{...}
\end{Verbatim}
