2008/06/11

これだけメソッドがあれば大概の事は出来る。
The Console Module

The Console module provides a simple console interface, which provides cursor-addressable text output, plus support for keyboard and mouse input.

The Console module is currently only available for Windows 95, 98, NT, and 2000. It probably works under Windows XP, but it hasn’t been tested on that platform.

試しに作ってみた。以下ソース

Oppai.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, time, codecs
import Console

class Oppai:
  def __init__(self):
    self.nest = 1

  def __getattr__(self, name):
    if name == 'Oppai':
      self.nest += 1
      return self
    else:
      return self.__dict__[name]

  def __call__(self):
    aa = [u"""
    _  ∩
  ( ゜∀゜)彡 おっぱい!おっぱい!
  (  ⊂彡
   |   | 
   し ⌒J
""", u"""
    _  ∩
  ( ゜∀゜)彡 おっぱい!
  (    | 
   |   | 
   し ⌒J
""", u"""
    _  
  ( ゜∀゜)  おっぱい!
  (  ⊂彡
   |   | 
   し ⌒J
"""]

    c = Console.getconsole()
    c.title("Oppai")
    for n in range(self.nest * 4):
      c.page()
      oppai = aa[n % 4 in (0, 2) and (n % 4)/2+1 or 0]
      l = 0
      for line in oppai.split("\n"):
        c.text(0, l, line.encode("mbcs"))
        l += 1
      time.sleep((n % 4) in (0, 2) and 0.5 or 0.15)
Oppai = Oppai()

if __name__ == '__main__':
  Oppai.Oppai.Oppai.Oppai()
使い方は
import Oppai

Oppai.Oppai.Oppai.Oppai()
こんな感じ。動かすと属性参照した分だけ、おっぱいアニメーションが流れます。
おっぱいそん
簡単ですね!
Posted at 13:43 | WriteBacks () | Edit
Edit this entry...

wikieditish message: Ready to edit this entry.






















A quick preview will be rendered here when you click "Preview" button.