[XML-SIG] what's wrong with me ?

祝顺民 zhusm@neusoft.com
Fri, 14 Sep 2001 11:41:32 +0800


这是 MIME 格式的具有很多部分消息。

--Boundary_(ID_QJuJKTI5pvxuC/v+Ky5A1w)
Content-type: text/plain; charset=gb2312
Content-transfer-encoding: QUOTED-PRINTABLE

  god help me ?please,see the below.
    1 #include <stdio.h>
    2 #include <string.h>
    3 #include "Python.h"
    4
    5
    6 int main(int argc,char **argv)
    7 {
    8
    9         PyObject * item;
   10         PyObject * POB0 =3D NULL, *POB1 =3D NULL;
   11
   12         Py_SetProgramName(argv[0]);//pass the programme'name to=
 the python
   13         Py_Initialize();        //initialize the python.
   14
   15         PyRun_SimpleString("print hello");
   16         PyRun_SimpleString("from xml.dom.minidom import parse")=
;
   17
   18         printf("are you ok\n");
   19         Py_Finalize();
   20         return 1;
   21 }
   22

gcc is pass .



root@zhusm:/home/zhusm/pythontest# ./test
Traceback (most recent call last):
  File "<string>", line 1, in ?
NameError: There is no variable named 'hello'
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/usr/lib/python2.0/xml/dom/minidom.py", line 19, in ?
    from StringIO import StringIO
  File "/usr/lib/python2.0/StringIO.py", line 32, in ?
    import errno
ImportError: /usr/lib/python2.0/errnomodule.so: undefined symbol: PyI=
nt_FromLong
are you ok


--Boundary_(ID_QJuJKTI5pvxuC/v+Ky5A1w)
Content-type: text/html; charset=gb2312
Content-transfer-encoding: QUOTED-PRINTABLE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb231=
2">
<META content=3D"MSHTML 6.00.2462.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV><FONT size=3D2>&nbsp;&nbsp;god help me ?please,see the below.</F=
ONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;1 #include=20
&lt;stdio.h&gt;<BR>&nbsp;&nbsp;&nbsp; 2 #include=20
&lt;string.h&gt;<BR>&nbsp;&nbsp;&nbsp; 3 #include=20
"Python.h"<BR>&nbsp;&nbsp;&nbsp; 4<BR>&nbsp;&nbsp;&nbsp; 5<BR>&nbsp;&=
nbsp;&nbsp;=20
6 int main(int argc,char **argv)<BR>&nbsp;&nbsp;&nbsp; 7 {<BR>&nbsp;&=
nbsp;&nbsp;=20
8<BR>&nbsp;&nbsp;&nbsp; 9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
PyObject * item;<BR>&nbsp;&nbsp;=20
10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PyObject * POB0 =
=3D NULL, *POB1=20
=3D NULL;<BR>&nbsp;&nbsp; 11<BR>&nbsp;&nbsp;=20
12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Py_SetProgramName(argv[0]);//pass the programme'name to the=20
python<BR>&nbsp;&nbsp; 13&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
Py_Initialize();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //initiali=
ze the=20
python.<BR>&nbsp;&nbsp; 14<BR>&nbsp;&nbsp;=20
15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PyRun_SimpleString=
("print=20
hello");<BR>&nbsp;&nbsp; 16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;=20
PyRun_SimpleString("from xml.dom.minidom import parse");<BR>&nbsp;&nb=
sp;=20
17<BR>&nbsp;&nbsp; 18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
printf("are you ok\n");<BR>&nbsp;&nbsp;=20
19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Py_Finalize();<BR>&nbsp;&nbsp;=20
20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 1;<BR>&nbsp=
;&nbsp; 21=20
}<BR>&nbsp;&nbsp; 22</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>gcc is pass .</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2><A=20
href=3D"mailto:root@zhusm:/home/zhusm/pythontest">root@zhusm:/home/zh=
usm/pythontest</A>#=20
=2E/test<BR>Traceback (most recent call last):<BR>&nbsp; File "&lt;st=
ring&gt;",=20
line 1, in ?<BR>NameError: There is no variable named 'hello'<BR>Trac=
eback (most=20
recent call last):<BR>&nbsp; File "&lt;string&gt;", line 1, in ?<BR>&=
nbsp; File=20
"/usr/lib/python2.0/xml/dom/minidom.py", line 19, in ?<BR>&nbsp;&nbsp=
;&nbsp;=20
=66rom StringIO import StringIO<BR>&nbsp; File "/usr/lib/python2.0/St=
ringIO.py",=20
line 32, in ?<BR>&nbsp;&nbsp;&nbsp; import errno<BR>ImportError:=20
/usr/lib/python2.0/errnomodule.so: undefined symbol: PyInt_FromLong<B=
R>are you=20
ok</FONT></DIV></BODY></HTML>


--Boundary_(ID_QJuJKTI5pvxuC/v+Ky5A1w)--