% -- I snipped this from the Python documentation distribution -- William Stein
% This sets up the {verbatim} environment to be indented and a minipage,
% and to have all the other mostly nice properties that we want for
% code samples.

\let\py@OldVerbatim=\verbatim
\let\py@OldEndVerbatim=\endverbatim
\RequirePackage{verbatim}
\RequirePackage{pstricks}
\newrgbcolor{dred}{0.7 0 0}
\newrgbcolor{black}{0 0 0}
\newrgbcolor{dgrey}{0.15 0.15 0.15}

\renewcommand{\verbatim}[1]{%
\begin{shadowbox}
   \setlength{\parindent}{1cm}%
\vspace{-2ex}\par\noindent
\dred\bf
\begin{minipage}[t]{\textwidth}
 \begin{listing}[#1]\label{listing:#1}
\vspace{0.5em}
   \mbox{}\vspace{-2.5em}\newline{}%
   \begin{list}{}{\setlength{\leftmargin}{6ex}}%
     \item%
     \black\py@OldVerbatim%
}
\renewcommand{\endverbatim}{%
    \py@OldEndVerbatim%
  \end{list}%
%------------------------------------------------------------------------%
\vspace{2ex}\end{listing}
\end{minipage}
\black
\end{shadowbox}
}



