Python论坛  - 讨论区

标题:Re: [python-chinese]类的使用问题

2004年09月24日 星期五 08:55

limodou limodou at gmail.com
Fri Sep 24 08:55:13 HKT 2004

x = syncLdap
这句话怎么没写()呢。这样不会创建对象啊。是不是笔误啊:)

On Fri, 24 Sep 2004 07:53:36 +0800, 0.706 <0.706 at 163.com> wrote:
> mike gaul,您好!
> 
> ======= 2004-09-23 16:25:11 您在来信中写道:=======
> 
> >======================================================
> >syncLdap.py
> >
> >class syncLdap:
> >    def readLdap():
> >        """
> >        """
> >
> >        try:
> >               l = ldap.open(ldap_host,ldap_port)
> >               l.protocol_version = ldap.VERSION3
> >               l.simple_bind_s(ldap_admin, ldap_pw)
> >
> >               print "Successfully bound to server.\n"
> >
> >        except ldap.LDAPError, error_message:
> >            print "Couldn't Connect. %s " %
> >error_message
> >
> >======================================================
> >ldap2db.py
> >
> >#!/usr/bin/python
> >
> >import ldap
> >
> >from config import *
> >
> >import syncLdap
> >
> >x = syncLdap
> 改成 x=syncLdap()试试
> >x.readLdap()
> >
> >=====================================================
> >运行结果怎么回事这样呢???
> >python ldap2db.py
> >
> >Traceback (most recent call last):
> >  File "ldap2db.py", line 27, in ?
> >    x.readLdap()
> >AttributeError: 'module' object has no attribute
> >'readLdap'
> >
> >
> >_________________________________________________________
> >Do You Yahoo!?
> >150万曲MP3疯狂搜,带您闯入音乐殿堂
> >http://music.yisou.com/
> >美女明星应有尽有,搜遍美图、艳图和酷图
> >http://image.yisou.com
> >1G就是1000兆,雅虎电邮自助扩容!
> >http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
> >_______________________________________________
> >python-chinese list
> >python-chinese at lists.python.cn
> >http://python.cn/mailman/listinfo/python-chinese
> >
> 
> = = = = = = = = = = = = = = = = = = = =
> 
>> 礼!
> 
> 0.706
> 0.706 at 163.com
> 2004-09-24
> 
> 
> 
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 
> 
> 



-- 
I like python!


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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号