python

formencode

formencode.api – Core classes for validation — FormEncode 2.0.0a1 documentation . if_key_missing Schemaで宣言しているキーが入力側のdictに含まれていない場合に このメンバで宣言している値をデフォルトとして渡す。 その後その値でValidateされる。…

mod_wsgi segmentation fault

Apache と Python でライブラリのバージョンが違うと×Google Code Archive - Long-term storage for Google Code Project Hosting. This is nearly always caused due to a shared library version conflict. That is, Apache or some Apache module is link…

Python アップグレード、更新

Pythonを更新するとeggは認識されなくなる。http://www.libspark.org/wiki/TracPlugins Python egg をビルドするための Python のバージョンと Trac を動かしている Python のバージョンが一致しなければなりません。 例えば、 Trac を Python のバージョン …

日付関連

休日を判定する 202:休日を判定する 次月 next month how to get the same day of next month of a given day in python using datetime - Stack Overflowhttp://labix.org/python-dateutilを使用する。

可変長引数

で、どうやったかといいますと、ここで**kwargsなのです。kwargs = {} kwargs['e'] = True kwargs['cc%d' % index] = func cmds.checkBoxGrp(ctlname, **kwagrs)これです。[Python] 可変長引数あれこれ – memlog

python 配列分割

■[python] リストを引数sizeのリストに分割して、そのリストのリストを返す関数 def split_seq(seq, size): return [seq[i:i+size] for i in range(0, len(seq), size)]2009-03-03 - kozo-niのはてなダイアリー python - Split list into smaller lists - St…

python 文字列操作

trim strip() 文字列をbool値に変換 Converting from a string to boolean in Python? - Stack Overflowformencodeを使う http://formencode.org/modules/validators.html >>> from formencode.validators import StringBool >>> StringBool.to_python('True…

Pylons + genshi

デフォルトテンプレート変数 http://pylonshq.com/docs/ja/0.9.7/views/#id8 c – テンプレートコンテキストオブジェクト (tmpl_context のエイリアス) tmpl_context – テンプレートコンテキストオブジェクト config – Pylons の PylonsConfig オブジェクト (…

genshi

基本 Documentation/xml-templates.html – Genshi As a shorthand, if the value of the py:strip attribute is empty, that has the same effect as using a truth value (i.e. the element is stripped). py:strip="True" は py:strip="" に省略可 複数デ…