Use <pre> tag.
I posted some Python code on my blog at blogspot http://pyarticles.blogspot.com/ . However, it not display my code correctly. How can I do to solve this problem ?
You can also use a syntax highlighter like Pygments. In the following article I demonstrate the usage of this great tool : http://gissolved.blogspot.com/2009/05/python-toolbox-2-pygments.html