我有场景使用LDAP和C#在Active Directory中创建新组.
请提供建议
我是python编程的新手.我创建了一个名为kitchen的包.我想通过__init__.py文件导入一个类文件.
我是python版本:3.3.2
OS平台:windows
Fridge.py
class Fridge:
def __init__(self, items={}):
"""Optionally pass in an initial dictionary of items"""
if type(items) != type({}):
raise TypeError("Fridge requires a dictionary but was given %s" %
type(items))
self.items = items
return
def _Get_Items(self):
print(self.items);
def _Get_Added_Values(self,lst):
values =0;
print(len(lst));
for index in lst:
values += index;
return values
def _Get_Seperetor(self,str1,lst):
str1=str1.join(lst);
return str1;
def _Get_Keys(self):
print(self.items.keys());
Run Code Online (Sandbox Code Playgroud)
Courses.py文件
class Courses:
def __init__(self, items=[]):
"""Optionally pass in an initial dictionary of items"""
if type(items) != …Run Code Online (Sandbox Code Playgroud) 我必须验证本地文件夹路径,其格式如下:..\sentinel\log.
对于C:\ sentinel\log,我有旧的正则表达式(/[\w]:\.*/)).我需要接受这条道路.
我从regexplibrary得到以下表达
var pathRE = new RegExp("/^((../ | [a-zA-Z0-9 _/ - \])*.[a-zA-Z0-9])"); 错误:SyntaxError:未终止的括号
当我执行时抛出此错误
我附上了我尝试过的代码
function checkFolderpath(path) {
try {
//var pathRE = new RegExp(/[\w]:\\.*/);
var pathRE = new RegExp("/^((\.\./|[a-zA-Z0-9_/\-\\])*\.[a-zA-Z0-9])");
if (pathRE.test(path)) {
$("#spanloggererror").html("");
return true;
}
else {
$("#spanloggererror").html(resx_Invalid_Loggerpath);
valtemp = 1;
}
return false;
}
catch (err) {
alert(err.Message);
}
Run Code Online (Sandbox Code Playgroud)
请建议我如何解决这个问题.
编辑:
路径值:..\Sentinel\log