ナンクル力学系

学んだ事を書き連ねていこう。

WordPress.comでもソースコードのハイライト出来るんだ

leave a comment »

wordpress.comだとソースコード上手く貼れないと思ってた.何でググって見つけられなかったのが不思議.

[sourcecode language=’言語の名前’]..[/sourcecode]で囲むだけらしい.

How do I post source code?

良いね!

class LineColor:
    def __init__(self):
        self.colors = ["b","g","r","c","m","y"]
        self.i = -1
    def get(self):
        self.i += 1
        return self.colors[ self.i % len(self.colors) ]

line_color = LineColor()

Written by tkf

September 11, 2008 at 8:54 pm

Posted in PC

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: