\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{Bio} \PYG{k+kn}{import} \PYG{n}{SeqIO}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{handle} \PYG{o}{=} \PYG{n+nb}{open}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}sequence.bigendian.2bit\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}rb\PYGZdq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{records} \PYG{o}{=} \PYG{n}{SeqIO}\PYG{o}{.}\PYG{n}{parse}\PYG{p}{(}\PYG{n}{handle}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}twobit\PYGZdq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{records}\PYG{o}{.}\PYG{n}{keys}\PYG{p}{()}
\PYG{g+go}{dict\PYGZus{}keys([\PYGZsq{}seq11111\PYGZsq{}, \PYGZsq{}seq222\PYGZsq{}, \PYGZsq{}seq3333\PYGZsq{}, \PYGZsq{}seq4\PYGZsq{}, \PYGZsq{}seq555\PYGZsq{}, \PYGZsq{}seq6\PYGZsq{}])}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{records}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}seq222\PYGZsq{}}\PYG{p}{]}
\PYG{g+go}{SeqRecord(seq=Seq(\PYGZsq{}TTGATCGGTGACAAATTTTTTACAAAGAACTGTAGGACTTGCTACTTCTCCCTC...ACA\PYGZsq{}), id=\PYGZsq{}seq222\PYGZsq{}, name=\PYGZsq{}\PYGZlt{}unknown name\PYGZgt{}\PYGZsq{}, description=\PYGZsq{}\PYGZlt{}unknown description\PYGZgt{}\PYGZsq{}, dbxrefs=[])}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{records}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}seq222\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{seq}
\PYG{g+go}{Seq(\PYGZsq{}TTGATCGGTGACAAATTTTTTACAAAGAACTGTAGGACTTGCTACTTCTCCCTC...ACA\PYGZsq{})}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{handle}\PYG{o}{.}\PYG{n}{close}\PYG{p}{()}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{records}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}seq222\PYGZsq{}}\PYG{p}{]}\PYG{o}{.}\PYG{n}{seq}
\PYG{g+gt}{Traceback (most recent call last):}
\PYG{c}{...}
\PYG{g+gr}{ValueError}: \PYG{n}{cannot retrieve sequence: file is closed}
\end{Verbatim}
