【发布时间】:2023-03-05 02:42:01
【问题描述】:
我正在尝试编写一个对 AD 进行身份验证的脚本。这是我的问题:
import sys
sys.stdout = open('output.csv', 'w')
def ad_dict(ldapobj,attr_dict={},recurse=0,auth=1,filter=()):
if ldapobj.find(',')==-1: ldapobj='cn='+ldapobj+','+Ad.ldap_main_loc
if auth: #setup authenticated connections
if debug: print 'auth'
当我运行它时,它会显示“未定义全局名称'debug'。 我以为调试是内置在这里的,为什么不定义呢?如果有帮助,我将在此脚本中使用 ActivePython。
【问题讨论】:
标签: python python-2.7 activepython