2010-06-13から1日間の記事一覧

bytesからchar*への変換

python3のマルチバイト文字列であるところのbytearraybytesをcのchar buf[20]に代入したい。textbuffer.h struct TextBuffer { TextBuffer(); char buf[20]; };textbuffer.cpp TextBuffer::TextBuffer() { } textbuffer.i %module textbuffer %{ #include "t…

pytnon3はsortの引数が変わっている

python3では微妙にsortの引数が変わっていた。 http://pythonconquerstheuniverse.wordpress.com/2009/01/07/moving-to-python-3-0-part1/ キーワード引数で、keyとかcmpを与えるように拡張されたみたいだ。それよりも、strがunicodeであることがswigとの絡…