Passing params?

G. David Kuhlman dkuhlman at netcom.com
Thu May 20 11:05:12 EDT 1999


A couple of examples:


	char * pathName;
	char * code;

	if (! PyArg_ParseTuple(args, "ss#", &pathName, &code))
	{
		Py_INCREF(Py_None);
		return Py_None;
	} // if

======

	char * pathName;
	const char * code;
	int size;

	if (! PyArg_ParseTuple(args, "ss#", &pathName, &code, &size))
	{
		Py_INCREF(Py_None);
		return Py_None;
	} // if

=====

See section 1.7 of the "Extending and Embedding the Python
Interpreter" manual there are several examples at the bottom of
this section.  Make sure to get the new 1.5.2 version of the
documentation.

  - Dave


Jr. King <n at n.com> wrote:
> The help showed how to pass one param to your c/c++ program from python by
> using PyArg_ParseTuple, but how would I pass 2 or more params to my c/c++
> program from python?






More information about the Python-list mailing list