#pragma section-numbers off CategoryPython に移動しました。 http://draco.boskant.nl/ http://starship.python.net/crew/gherman/ http://www.roy.hi-ho.ne.jp/pastel/home/Python/index.html http://mail.python.org/pipermail/pythonmac-sig/2002-June/005700.html http://www.lysator.liu.se/xenofarm/python-stable/tmp-server/python/dist/src/Mac/Demo/building.html http://www.astro.washington.edu/owen/InstallingPythonOnJaguar.html http://wxpython.org/BUILD.osx.txt http://www.astro.washington.edu/owen/AquaEnvVar.html = WSH = Win環境のスクリプト環境。 [http://www.python.jp/Zope/download/win32all Python for Windows Extensions]を入れた後 以下のスクリプトを作成してみる。 {{{ #! /bin/env cscript WScript.Echo("The script name is ", WScript.ScriptName) arglen=len(WScript.Arguments) if arglen>0: for i in range(arglen): s="arg(%d): %s" % (i, WScript.Arguments(i)) WScript.Echo(s) }}} これをargprint.pysとかの名前で保存。 Cygwinが導入ずみならば {{{ ./argprint.pys }}} で実行すると動作する。 Cygwinいれていない場合は {{{ C:\WINNT\system32\cscript.exe }}} にpysを関連ずけしておくとコマンドライン起動および、クリック起動が可能になる。 http://www.roy.hi-ho.ne.jp/mutaguchi/wsh/ http://member.nifty.ne.jp/aya/wsh/ 2ちゃんねるからコピー MSオフィースの冴子先生を操る(動作未確認) {{{ # -*- coding: mbcs -*- from win32com.client import Dispatch from Tkinter import * import time ACTION = [ ("正面", 1), ("登場", 2), ("退場", 3), ("拍手", 6), ("注意1", 11), ("注意2", 12), ("検索", 13), ("印刷", 18), ("右手", 19), ("ノート", 22), ("バイバイ", 23), ("考える", 24), ("メール", 25), ("考える2", 26), ("縮小", 31), ("拡大", 32), ] def callback(xl, n): xl.Visible = True xl.Assistant.On = True xl.Assistant.Visible = True res = xl.Assistant.Animation = n xl = Dispatch("Excel.Application") try: xl.Visible = True xl.Assistant.Visible = True root = Tk() root.wm_title(unicode(xl.Assistant.Name)) for k, v in ACTION: b = Button(root, text=unicode("%s(%s)" % (k, v)), font=("MS Gothic", 9), command=lambda xl=xl, v=v: callback(xl, v)) b.pack(expand=YES, fill=X) root.after(5, lambda xl=xl, v=2: callback(xl, v)) root.mainloop() finally: xl.Quit() }}}