The approach with mdframed is only mentioned as an alternative. Minted itself already has an option to draw frames:
\documentclass{article}
\usepackage{minted}
\begin{document}
\inputminted[frame=single]{python}{test.py}
\end{document}

If you insist on mdframed:
\documentclass{article}
\usepackage{minted}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}
\inputminted{python}{test.py}
\end{mdframed}
\end{document}
or a new macro:
\documentclass{article}
\usepackage{minted}
\usepackage{mdframed}
\newcommand{\inputframedminted}[2]{%
\begin{mdframed}
\inputminted{#1}{#2}
\end{mdframed}
}
\begin{document}
\inputframedminted{python}{test.py}
\end{document}
renaming the command:
\documentclass{article}
\usepackage{minted}
\usepackage{mdframed}
\let\inputmintedorg\inputminted
\renewcommand{\inputminted}[2]{%
\begin{mdframed}
\inputmintedorg{#1}{#2}
\end{mdframed}
}
\begin{document}
\inputminted{python}{test.py}
\end{document}
mdframedwhenever an\inputmintedcommand appears? – Victor Aug 13 '19 at 11:46