\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{import} \PYG{n+nn}{os}
\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{SeqIO}
\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{Entrez}

\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{n}{filename} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}EU490707.gbk\PYGZdq{}}
\PYG{k}{if} \PYG{o+ow}{not} \PYG{n}{os}\PYG{o}{.}\PYG{n}{path}\PYG{o}{.}\PYG{n}{isfile}\PYG{p}{(}\PYG{n}{filename}\PYG{p}{):}
    \PYG{c+c1}{\PYGZsh{} Downloading...}
    \PYG{n}{net\PYGZus{}handle} \PYG{o}{=} \PYG{n}{Entrez}\PYG{o}{.}\PYG{n}{efetch}\PYG{p}{(}
        \PYG{n}{db}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}nucleotide\PYGZdq{}}\PYG{p}{,} \PYG{n+nb}{id}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}EU490707\PYGZdq{}}\PYG{p}{,} \PYG{n}{rettype}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}gb\PYGZdq{}}\PYG{p}{,} \PYG{n}{retmode}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}text\PYGZdq{}}
    \PYG{p}{)}
    \PYG{n}{out\PYGZus{}handle} \PYG{o}{=} \PYG{n+nb}{open}\PYG{p}{(}\PYG{n}{filename}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}w\PYGZdq{}}\PYG{p}{)}
    \PYG{n}{out\PYGZus{}handle}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{n}{net\PYGZus{}handle}\PYG{o}{.}\PYG{n}{read}\PYG{p}{())}
    \PYG{n}{out\PYGZus{}handle}\PYG{o}{.}\PYG{n}{close}\PYG{p}{()}
    \PYG{n}{net\PYGZus{}handle}\PYG{o}{.}\PYG{n}{close}\PYG{p}{()}
    \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}Saved\PYGZdq{}}\PYG{p}{)}

\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}Parsing...\PYGZdq{}}\PYG{p}{)}
\PYG{n}{record} \PYG{o}{=} \PYG{n}{SeqIO}\PYG{o}{.}\PYG{n}{read}\PYG{p}{(}\PYG{n}{filename}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}genbank\PYGZdq{}}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{record}\PYG{p}{)}
\end{Verbatim}
