2009-02-01から1ヶ月間の記事一覧

Python のアプリケーションへの埋め込みについて

セットアップ用のパッケージ python-X.X.X.msi を使わないで使う際の注意。結構面倒くさい。 Python 2.6 SxS の関係上、Microsoft Visual C++ 2008 Redistributable Package をインストールする必要がある。 必要なバイナリは python26.dll のみ。 sys.path …

[Python] [C] override stdout&stderr output from C

#include <Python.h> typedef struct { PyObject_HEAD /* Type-specific fields go here. */ } MyStdout; static PyObject *MyStdout_write(MyStdout* self, PyObject *args) { char *data = PyString_AsString(args); if (data){ printf("%s", data); } Py_RETURN_NON</python.h>…