\documentclass[10pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\begin{document}
\fbox{\parbox[c][5cm][c]{6cm}{\hspace{2.0cm}Python Code}}
\end{document}