6

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?

djq
  • 14,810
  • 45
  • 122
  • 157

1 Answers1

12

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
  • 174,939
  • 50
  • 355
  • 478