You can download this template and use it like any other latex template.
Find the line ´\usepackage[english]{babel}´ and change ´english´ to your preferred language.
Find the line ´\thispagestyle{fancy}´ and delete it.
Use the following syntax:
\begin{lstlisting}[language=Python]
def main():
print("your code here")
\end{lstlisting}
