おみくじ(random.choice)
#! /usr/bin/python # coding: Shift_JIS import random kuji = random.choice(['大吉', '中吉', '小吉', '吉', '凶', '大凶']) print "Content-type: text/html" print """ <html> <head> <title>おみくじ</title> </head> <body> おみくじ:%s </body> </html> """ % kuji
〔 実行する 〕