我试图找出如何获取进入我的jython websphere相关模块的参数。我显然不明白这一点,所以任何帮助都表示赞赏。以下是我尝试的完全不满意/无功能的内容:
execfile('wsadminlib.py')
Opts = {}
for key in Opts.key() :
print(' option passed in is: ' + key)
#for c in listServerClusters():
# startCluster(c);
# print(c + ' status: ' + str(isClusterStarted(c)) )
答案 0 :(得分:0)
如果您需要阅读另一个文件/模块中定义的属性,可以//test is the key in the map shown above
vector<pair<int,int>> tmpVec = assessedTest__name_result.at(test);
sort (tmpVec.begin(),tmpVec.end(),vecIdSort);
...
bool myClass::vecNameSort(const pair<string,int>& firstElem, const pair<string,int>& secondElem, const string& test){
if (firstElem.first < secondElem.first)
return true;
if (firstElem.first > secondElem.first)
return false;
return AssSort(firstElem.first, secondElem.first,test); //in case the elements are the same
}
bool myClass::AssSort (const int firstId, const int secId,const string& test){
bool foundFirst,foundSecond;
vector<pair<string,int>>::iterator first,second;
for (auto it = assessedTest__name_result.at(test).begin();it != assessedTest__name_result.at(test).end(); it++){
if ((*it).first == firstId){
first = it;
foundFirst = true;
}
if ((*it).first == secId){
second = it;
foundSecond = true;
}
if (foundFirst && foundSecond) break;
}
return first < second;
}
它们。例如:
<强> properties.py 强>
import
<强> script.py 强>
properties = {
'prop1': 'test'
}
def get():
return properties