views:

643

answers:

1

I'm using the following LaTeX code in a Beamer presentation:

\begin{frame}
  \begin{figure}
  \centering
      \tiny
   \lstset{language=python}
         \lstinputlisting{code/get_extent.py}
   \end{figure}
\end{frame}

Is it possible to select specific lines from my get_extent.py file rather than displaying it all?

+7  A: 

This has nothing to do with beamer; it's about a listings feature. Its excellent manual has more. For example:

\lstinputlisting[firstline=2,lastline=5]{code/get_extent.py}
Thomas