There is an overleaf template for pythonTEX. I change it's document class into beamer and then I find a strange error with the following code:
\begin{frame}{Example}
\begin{minted}{latex}
\py{2+2}
\end{minted}
\end{frame}
error information:
Runaway argument?
\py {2+2} \end {minted}
Paragraph ended before \FV@BeginScanning was complete.
<to be read again>
\par
l.44 \end{frame}
A simple change can make it work well:
\begin{frame}[fragile]
\frametitle{Example}
\begin{minted}{latex}
\py{2+2}
\end{minted}
\end{frame}
Why can't I set the frame title directly?
minted
is one of the verbatim environments (=basically any code environment) which requires this special treatment.\begin{frame}[fragile]{title} test \end{frame}