我们编写一个简单的c++扩展,实现新建文件并且往文件中写一些内容的功能。 fputsmodule.c #define PY_SSIZE_T_CLEAN #include <Python.h> static PyObject *StringTooShortError = NULL; static PyObject *method_fputs(PyObject *self, PyObject *args, PyObject *kw) { char *str, *filename = NULL; int...