本文整理汇总了Python中General.repeat方法的典型用法代码示例。如果您正苦于以下问题:Python General.repeat方法的具体用法?Python General.repeat怎么用?Python General.repeat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类General
的用法示例。
在下文中一共展示了General.repeat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Add_List
# 需要导入模块: import General [as 别名]
# 或者: from General import repeat [as 别名]
def Add_List(self, Items, BGColors):
for n in range(0, len(Items)):
for i in range(0, self.nCol):
self.Columns[self.ColNames[i]]['List'].insert(END, General.repeat(' ', self.Columns[self.ColNames[i]]['Spacer']) + str(Items[n][i]))
if BGColors[n][i] != None:
self.Columns[self.ColNames[i]]['List'].itemconfig(self.Columns[self.ColNames[i]]['List'].size()-1,
bg=BGColors[n][i])
示例2: Add
# 需要导入模块: import General [as 别名]
# 或者: from General import repeat [as 别名]
def Add(self, Item, BGColor):
for i in range(0, self.nCol):
try:
self.Columns[self.ColNames[i]]['List'].insert(END, General.repeat(' ', self.Columns[self.ColNames[i]]['Spacer']) + str(Item[i]))
if BGColor[i] != None:
self.Columns[self.ColNames[i]]['List'].itemconfig(self.Columns[self.ColNames[i]]['List'].size()-1, bg=BGColor[i])
except:
pass
示例3: Set
# 需要导入模块: import General [as 别名]
# 或者: from General import repeat [as 别名]
def Set(self, Item, Col, Value, UptCol):
Found = False
# Does the column exist
for i in range(0, self.nCol):
if self.ColNames[i] == Col:
Found = True
break
if Found:
# Does item exist in column
Index = 0
Found = False
for item in self.Columns[Col]['List'].get(0, END):
#if item.replace(General.repeat(' ',self.Columns[Col]['Spacer']),'') == str(Item):
if item.lstrip() == str(Item):
Found = True
break
Index += 1
if Found:
# Does the update column exist
Found = False
for i in range(0, self.nCol):
if self.ColNames[i] == UptCol:
Found = True
break
if Found:
# Set item value
self.Columns[UptCol]['List'].delete(Index)
try:
self.Columns[UptCol]['List'].insert(Index, General.repeat(' ',self.Columns[UptCol]['Spacer']) + str(Value))
except:
self.Columns[UptCol]['List'].insert(END, General.repeat(' ',self.Columns[UptCol]['Spacer']) + str(Value))