Pmw.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:ecel 作者: ARL-UTEP-OC 项目源码 文件源码
def index(self, index):
        listLength = len(self._itemList)
        if type(index) == types.IntType:
            if index < listLength:
                return index
            else:
                raise ValueError, 'index "%s" is out of range' % index
        elif index is END:
            if listLength > 0:
                return listLength - 1
            else:
                raise ValueError, 'OptionMenu has no items'
        else:
            if index is SELECT:
                if listLength > 0:
                    index = self.getcurselection()
                else:
                    raise ValueError, 'OptionMenu has no items'
            if index in self._itemList:
                return self._itemList.index(index)
            raise ValueError, \
                    'bad index "%s": must be a ' \
                    'name, a number, END or SELECT' % (index,)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号