I am writing some code in C and in Python.
I have a python file called sample.py
which accepts two string parameters.
My C program calls the python function using the PyRun_SimpleString()
. In this way I am not able to pass any parameters.
By PyRun_SimpleString()
:
int main(int argc,char *argv[])
{
......
PyRun_SimpleString("import sample\nsample.mainfunc("argv[1]",'Isolated_domU_t')\n");
.....
}
How can I pass parameters argv[1]
by using PyRun_SimpleString(*)
?