Python论坛  - 讨论区

标题:[python-chinese] python调用动态链接库的问题

2007年04月02日 星期一 19:14

SANG Junjun crabhit在gmail.com
星期一 四月 2 19:14:51 HKT 2007

系统应该是能找到的 我用C调它没问题
即使和.py文件放在一起也会出错 我怀疑是配置的问题 但我用的是ubuntu默认的python配置

On 4/2/07, python-chinese-request在lists.python.cn <
python-chinese-request在lists.python.cn> wrote:
>
> 想在 python-chinese 邮件列表发言,请写信给:
>         python-chinese在lists.python.cn
>
> 要订阅或者退订列表,可以访问万维网地址:
>         http://python.cn/mailman/listinfo/python-chinese
> 或者可以向:
>         python-chinese-request在lists.python.cn
> 发送主题或者正文为'help'的邮件。
>
> 您可以通过邮件地址:
>         python-chinese-owner在lists.python.cn
> 联系到此列表的管理员。
>
> 当回信时,请给一个适当的标题,这样会比 "Re:
> Contents of python-chinese digest..."更清楚明白。
>
>
> 本日主题:
>
>    1. Re: python调用动态链接库的问题 (GoodGoodStudy&DayDayUp;)
>    2. Re: (无主题) (Can Xue)
>    3. Re: Eclipse下代码自动提示的问题 (Xell Zhang)
>    4. Re: 怎样动态import 文件 (Linker Lin)
>    5. Re: Eclipse下代码自动提示的问题 (Linker Lin)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 2 Apr 2007 17:20:39 +0800
> From: GoodGoodStudy&DayDayUp; <peixu.zhu在gmail.com>
> Subject: Re: [python-chinese] python调用动态链接库的问题
> To: python-chinese在lists.python.cn
> Message-ID:
>         <919f7c1b0704020220v6b56ed9bi9e0a13b103821754在mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 看看你把你的 .so 文件放在哪里。
> 确保你的 .so 文件能够被操作系统找到。
>
> 报那个错误是因为操作系统在它的动态链接库搜索目录中找不到这个文件。
>
>
> >    3. python调用动态链接库的问题 (SANG Junjun)
> >
> > Message: 3
> > Date: Mon, 2 Apr 2007 15:21:09 +0800
> > From: "SANG Junjun" <crabhit在gmail.com>
> > Subject: [python-chinese] python调用动态链接库的问题
> > To: python-chinese在lists.python.cn
> > Message-ID:
> >         <659f3ef40704020021n3ffc485fq1e81123f691712ff在mail.gmail.com>
> > Content-Type: text/plain; charset="gb2312"
> >
> > 大家好
> > 我在ubuntu6.10下使用python调用动态链接库
> > functest = ctypes.cdll.func
> >
> > 出现这样的问题:
> > sang在sang-desktop:~/test$ ./test.py
> > Traceback (most recent call last):
> >   File "./test.py", line 6, in ?
> >     functest = ctypes.cdll.func
> >   File "/usr/lib/python2.4/site-packages/ctypes/__init__.py", line 390,
> in
> > __getattr__
> >     dll = self._dlltype(name)
> >   File "/usr/lib/python2.4/site-packages/ctypes/__init__.py", line 315,
> in
> > __init__
> >     self._handle = _dlopen(self._name, mode)
> > OSError: func: cannot open shared object file: No such file or directory
> >
> > 不知道这是为什么?
> >
> >
> > --
> > Best Regards,
> > SANG JUNJUN
> > -------------- 涓���ㄥ� --------------
> > 一个HTML附件被移除...
> > URL:
> >
> http://python.cn/pipermail/python-chinese/attachments/20070402/590a8a48/attachment-0001.html
> >
> > ------------------------------
> >
>
>
> --
> THINK big, DO small.
> -------------- 下一部分 --------------
> 一个HTML附件被移除...
> URL:
> http://python.cn/pipermail/python-chinese/attachments/20070402/209a174b/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Mon, 2 Apr 2007 17:50:12 +0800
> From: "Can Xue" <xuecan在gmail.com>
> Subject: Re: [python-chinese] (无主题)
> To: python-chinese在lists.python.cn
> Message-ID:
>         <c49ec5b90704020250u61ea29ddw67cffb67fbccdb7d在mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> 满屏 base64 编码,该不会看个信还要 base64.b64decode(... 吧
>
> ------------------------------
>
> Message: 3
> Date: Mon, 2 Apr 2007 18:41:14 +0800
> From: "Xell Zhang" <xellzhang在gmail.com>
> Subject: Re: [python-chinese] Eclipse下代码自动提示的问题
> To: python-chinese在lists.python.cn
> Message-ID:
>         <a7ef6100704020341p53b0f491p970949a134568639在mail.gmail.com>
> Content-Type: text/plain; charset="gb2312"
>
> Image.open
> ()是一个函数我知道,可是im就是一个实例了阿,我的意思是下面我接着打:"im.",点后面应该可以提示rotate()这样的函数吧?可是没有……
>
> On 4/2/07, Can Xue <xuecan在gmail.com> wrote:
> >
> > 因为 Image.open(...) 是一个函数,而不是一个类的实例,虽然它返回类的实例。
> > 这大概是不需要声明变量类型的语言在 IDE 环境不可避免的问题吧.
> >
> > 在 07-4-1,Xell Zhang<xellzhang在gmail.com> 写道:
> > > hi
> > > 我是一个python新手,目前用Eclipse作为开发环境,安装了pydev这个插件,感觉良好。
> > > 今天安装了PIL (Python Image Library),并且在Eclipse中进行了设置:
> > > Window -> Preferences -> Pydev ->
> > > Interpreter-Python下,把PIL加入了Forced builtin
> > > libs。可是写代码的时候,无法自动提示类的所有变量及函数,例如我写
> > > from PIL import Image
> > > im = Image.open('...')
> > > im.
> > > 点后面应该可以提示出所有函数吧?可是没有,只有一些 "__call__", "__doc__", "fun_closure"
> > 之类的,没有rotate,
> > > resize这样的函数,但是我确实可以用rotate, resize函数。请问是什么原因?
> > >
> > > _______________________________________________
> > > 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
> -------------- 涓���ㄥ� --------------
> 一个HTML附件被移除...
> URL:
> http://python.cn/pipermail/python-chinese/attachments/20070402/98cf87f9/attachment.html
>
> ------------------------------
>
> Message: 4
> Date: Mon, 2 Apr 2007 18:59:46 +0800
> From: "Linker Lin" <linkerlin88在gmail.com>
> Subject: Re: [python-chinese] 怎样动态import 文件
> To: python-chinese在lists.python.cn
> Message-ID:
>         <2300acfb0704020359w58d7bc26m53d270bbea9ae5b0在mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 这个是可以的。
>
> On 4/1/07, Alex Cheng <chengxin1985在gmail.com> wrote:
> >
> > 不好意思, 弄错了.
> > 应该是:
> > moduleName = "string"
> > exec("import " + moduleName)
> >
> > 在07-4-1,Alex Cheng < chengxin1985在gmail.com> 写道:
> > >
> > > 试试 这个:
> > >
> > > moduleName = "string"
> > > eval("import " + moduleName)
> > >
> > >
> > > 在07-3-31,jessinio smith < jessinio在gmail.com> 写道:
> > > >
> > > > __import__(...)
> > > >     __import__(name, globals, locals, fromlist) -> module
> > > >
> > > >     Import a module.  The globals are only used to determine the
> > > > context;
> > > >     they are not modified.  The locals are currently unused.  The
> > > > fromlist
> > > >     should be a list of names to emulate ``from name import ...'',
> or
> > > > an
> > > >     empty list to emulate ``import name''.
> > > >     When importing a module from a package, note that __import__('
> A.B',
> > > > ...)
> > > >     returns package A when fromlist is empty, but its submodule B
> when
> > > >     fromlist is not empty.
> > > >
> > > >
> > > > On 3/31/07, PianoPan < pianopan在gmail.com> wrote:
> > > > >
> > > > > 也就是根据变量的内容包含不同的文件,由运行时变量来决定要import 的文件的名字
> > > > > _______________________________________________
> > > > > 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
> > > >
> > >
> > >
> > >
> > > --
> > > powered by python
> >
> >
> >
> >
> > --
> > powered by python
> > _______________________________________________
> > 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
> >
>
>
>
> --
> Linker M Lin
> linkerlin88在gmail.com
>   ※※※※※※※※※
>   ※※我思故我在※※
>   ※※※※※※※※※
> -------------- 下一部分 --------------
> 一个HTML附件被移除...
> URL:
> http://python.cn/pipermail/python-chinese/attachments/20070402/1a21ed2a/attachment.htm
>
> ------------------------------
>
> Message: 5
> Date: Mon, 2 Apr 2007 19:02:08 +0800
> From: "Linker Lin" <linkerlin88在gmail.com>
> Subject: Re: [python-chinese] Eclipse下代码自动提示的问题
> To: python-chinese在lists.python.cn
> Message-ID:
>         <2300acfb0704020402ua97d600o1876186326c14952在mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 既然是新手,强烈推荐limodou兄开发的
> Ulipad!!!!!!!!!!!!!!!!!!!!!
> 超级好用!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> 不用一辈子遗憾o(∩_∩)o...哈哈
>
>
> On 4/1/07, Xell Zhang <xellzhang在gmail.com> wrote:
> >
> > hi
> > 我是一个python新手,目前用Eclipse作为开发环境,安装了pydev这个插件,感觉良好。
> > 今天安装了PIL (Python Image Library),并且在Eclipse中进行了设置:
> > Window -> Preferences -> Pydev -> Interpreter-Python下,把PIL加入了Forced
> > builtin libs。可是写代码的时候,无法自动提示类的所有变量及函数,例如我写
> > from PIL import Image
> > im = Image.open('...')
> > im.
> > 点后面应该可以提示出所有函数吧?可是没有,只有一些 "__call__", "__doc__", "fun_closure"
> > 之类的,没有rotate, resize这样的函数,但是我确实可以用rotate, resize函数。请问是什么原因?
> >
> > _______________________________________________
> > 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
> >
>
>
>
> --
> Linker M Lin
> linkerlin88在gmail.com
>   ※※※※※※※※※
>   ※※我思故我在※※
>   ※※※※※※※※※
> -------------- 下一部分 --------------
> 一个HTML附件被移除...
> URL:
> http://python.cn/pipermail/python-chinese/attachments/20070402/cb2e3a41/attachment.html
>
> ------------------------------
>
> _______________________________________________
> python-chinese mailing list
> python-chinese在lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
>
> 结束python-chinese 摘要, 卷 40, 发布 10
> **********************************************
>



-- 
Best Regards,
SANG JUNJUN
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20070402/8008fc10/attachment-0001.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号