[python-chinese] python25_d生成的有问题?如何解决的!附源代码

Gerald Lee leejd80在gmail.com
星期五 八月 3 19:49:13 HKT 2007


urllib2可能用到socket.pyd吧,这个在debug模式下面也是有_d的版本的,需要自己编译,你看看输出的日志就知道了


在 07-8-3,Bright Lee<m2lihui在163.com> 写道:
>
>
>
> 两个测试代码,一个是 cxxusepy.cpp ,一个是py脚本的
>
> // cxxusepy.cpp : 定义控制台应用程序的入口点。
> //
>
> #include "stdafx.h"
> #include <python.h>
> int _tmain(int argc, _TCHAR* argv[])
> {
>  Py_Initialize();
>
>  PyObject * pModule = NULL;
>  PyObject * pFunc   = NULL;
>  PyObject * pArg    = NULL;
>
>  pModule = PyImport_ImportModule("test2");
>  pFunc   = PyObject_GetAttrString(pModule, "Hello");
>  pArg    = Py_BuildValue("(s)", "http://www.google.com");
>
>  PyEval_CallObject(pFunc, pArg);
>
>  Py_Finalize();
>
>  return 0;
> }
>
> #Filename test2.py
> #!/usr/bin/env python
> # Obtain Web Page - Chapter 6 - dump_page.py
> import sys, urllib2
> def Hello(s):
>     print "Hello, world!"
>     print s
>
>
> def DumpPage(url):
>     req = urllib2.Request(url)
>     fd = urllib2.urlopen(req)
>     while 1:
>         data = fd.read(1024)
>         if not len(data):
>             break
>         sys.stdout.write(data)
>
> 在使用调试的动态库(python25_d.dll)时
> Py文件中,如果去掉import sys, urllib2及DumpPage函数就能成功?不然pModule =
> PyImport_ImportModule("test2");
> 的返回值为空
>
> 使用Release(python25.dll)的库时没有问题
>
> ----- Original Message -----
> From: Robert Chen
> To: python-chinese在lists.python.cn
> Sent: Thursday, August 02, 2007 8:46 PM
> Subject: Re: [python-chinese]python25_d生成的有问题?如何解决的!
>
> "发现不中两个模块加载都会失败"
>
> 这到底是啥意思啊
>
>
>
> On 8/2/07, Bright Lee <m2lihui在163.com> wrote:
> >
> >
> > 自己下的源代码编译的python25_d.dll有问题
> > 在调试版本时,发现不中两个模块加载都会失败.
> > 后来在用Release版本就没有问题了,用的python25.dll就没有问题,Why?
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to
> python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to
> python-chinese-request在lists.python.cn
> > Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
> >
>
>
>
> --
> Robert
> 关注Python 关注搜索
> Dynamic Life――http://blog.csdn.net/balabalamerobert
>
>  ________________________________
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to
> python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to
> python-chinese-request在lists.python.cn
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to
> python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to
> python-chinese-request在lists.python.cn
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>


关于邮件列表 python-chinese 的更多信息