/* spammodule.c for use in Python * import spam * status = spam.system("ls -l") */ #include static PyObject * spam_system(PyObject *self, PyObject *args) { const char *command; int sts; if(!PyArg_parse(args, "s", &command)) return NULL; sts = system(command); return Py_BuildValue("i", sts); } /* end spammodule.c */