2009-01-01から1ヶ月間の記事一覧
cat クラスをコンベンションに従って書き換えていかないと機能強化できないのがいけてない. from __future__ import with_statement from re import compile class cat(object): def __init__(self, filename): def _cat(filename): with open(filename) as …
Jython で PDF にページ番号を書き込むスクリプト. Jython 2.2.1 + iText 2.1.4 で動作確認. from sys import argv from java.io import FileOutputStream from com.lowagie.text.pdf import BaseFont, PdfReader, PdfStamper, PdfContentByte def write_nom…
実行したスクリプトそれ自身の絶対パスを返す関数. from sys import argv from os.path import dirname, abspath def self_path(): return abspath(dirname(argv[0]))