Re: embedded python example: PyString_FromString doesnt work?

2005-03-25 Thread Denis S. Otkidach
On Thu, 24 Mar 2005 21:12:18 + David Harris wrote: DH int DH main(int argc, char *argv[]) DH { DH PyObject *pName, *s, *pModule, *pDict, *pFunc; DH PyObject *pArgs, *pValue; DH int i; DH DH if (argc 3) { DH fprintf(stderr,Usage: call pythonfile funcname [args]\n); DH

Re: embedded python example: PyString_FromString doesnt work?

2005-03-25 Thread Brano Zarnovican
wierd. does: http://www.python.org/doc/2.3.­2/ext/pure-embedding.html work for you ? Yes. It does. ./test_String script1.py multiply 4 5 Don't run it with the .py suffix. The argv[1] is a module name, not a filename.. Even if you do, it may not find the module. Depending of what you have

Re: embedded python example: PyString_FromString doesnt work?

2005-03-25 Thread David Harris
On Fri, 25 Mar 2005 11:09:35 +0300, Denis S. Otkidach wrote: DH Calling the program gives an error; DH [EMAIL PROTECTED]:~/source/python ./test_String script1.py multiply 4 DH 5 import went bang... DH ImportError: No module named script1.py DH script1.py exists and it is in the same

Re: embedded python example: PyString_FromString doesnt work?

2005-03-24 Thread Brano Zarnovican
Hi David ! I cannot see anything wrong on your code. So, I'm posting my working example. Hint: try to determine, why it is returning NULL (the PyErr_Print() call) BranoZ #include Python.h int main(int argc, char *argv[]) { PyObject *s; int ret; if (argc 2) return -1;

Re: embedded python example: PyString_FromString doesnt work?

2005-03-24 Thread David Harris
On Thu, 24 Mar 2005 06:39:47 -0800, Brano Zarnovican wrote: Hi David ! I cannot see anything wrong on your code. So, I'm posting my working example. Hint: try to determine, why it is returning NULL (the PyErr_Print() call) BranoZ OK your example works fine. I inserted it in the

embedded python example: PyString_FromString doesnt work?

2005-03-23 Thread David Harris
I'm trying the embedded python example here: http://www.python.org/doc/2.3.2/ext/pure-embedding.html int main(int argc, char *argv[]) { PyObject *pName, *pModule, *pDict, *pFunc; PyObject *pArgs, *pValue; int i; if (argc 3) { fprintf(stderr,Usage: call pythonfile