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

\PYG{n}{records} \PYG{o}{=} \PYG{n}{SeqIO}\PYG{o}{.}\PYG{n}{parse}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}ls\PYGZus{}orchid.gbk\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}genbank\PYGZdq{}}\PYG{p}{)}
\PYG{n}{out\PYGZus{}handle} \PYG{o}{=} \PYG{n}{StringIO}\PYG{p}{()}
\PYG{n}{SeqIO}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{n}{records}\PYG{p}{,} \PYG{n}{out\PYGZus{}handle}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}fasta\PYGZdq{}}\PYG{p}{)}
\PYG{n}{fasta\PYGZus{}data} \PYG{o}{=} \PYG{n}{out\PYGZus{}handle}\PYG{o}{.}\PYG{n}{getvalue}\PYG{p}{()}
\PYG{k}{print}\PYG{p}{(}\PYG{n}{fasta\PYGZus{}data}\PYG{p}{)}
\end{Verbatim}
