2007-05-06から1日間の記事一覧
xrcedでツールバーにラベルを入れてみたんだけど、 なぜか背景色が白くなってしまう @ windows環境。 誰かヘルプ!!!
SQLを実行して、その行を1つずつyieldする。 こんな使い方であっているかな。 def search_tags(self, tags): query = ' and '.join(['tag = ?' for w in tags]) self.cur.execute('SELECT id, fullpath, filetitle, ext, size, sha512, mtime FROM files WHE…
os.walkなんかでpathを次々ととってくるときに、 path.decode(sys.getfilesystemencoding()) でファイル名をUnicode文字列に出来る。
http://pleac.sourceforge.net/pleac_python/numbers.html から。 def commify(amount): amount = str(amount) firstcomma = len(amount)%3 or 3 # set to 3 if would make a leading comma first, rest = amount[:firstcomma], amount[firstcomma:] segment…
Python for Windows Extensionsが入っている環境だったら、 以下のファイルにサンプルがある。 C:\Python25\Lib\site-packages\win32comext\shell\demos\servers\context_menu.py
グニャラくんのグニャグニャ備忘録@はてな で全文検索エンジンSennaの話とPythonの話とをまとめて書いていました。Pythonの(しかも細かい)話が多くなりそうなので分割。 というわけで、皆さんヨロシク。