How to paste python code on wordpress?

could ildg could.net at gmail.com
Tue Nov 22 00:30:08 EST 2005


Thank you~
It works!
but how can paste "<" and ">", please?
these 2 symbols will also confuse wordpress and I can't publish what I want.

On 11/22/05, Dan Lowe <dan at tangledhelix.com> wrote:
>
>
> On Nov 21, 2005, at 8:17 PM, could ildg wrote:
>
> > Wordpress.com <http://Wordpress.com> blog will eat up the spaces before
> a line,
> > just as it will trim every line of my article. So I can't paste
> > python code indentedly.
> > Does any one use wordpress blog here?
> > Please tell me how to leave the sapces as they are when publishing
> > ariticles on the blog,
>
> You can enclose the code in a PRE block, like this:
>
> <pre>
> def foobar():
> print "abc"
> if x == 3:
> print "def"
> print "ghi"
> </pre>
>
> If you don't care for how it renders in a browser, hack your CSS to
> make PRE render in a way you like.
>
> -dan
>
> --
> Well sure the government lies, and the press lies, but in a democracy
> they aren't the same lies. -Alexis A. Gilliland
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20051122/d1b8ef83/attachment.html>


More information about the Python-list mailing list