本文整理汇总了Python中cell.Cell.section方法的典型用法代码示例。如果您正苦于以下问题:Python Cell.section方法的具体用法?Python Cell.section怎么用?Python Cell.section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cell.Cell
的用法示例。
在下文中一共展示了Cell.section方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_cell
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import section [as 别名]
def create_cell(self, row, col, value):
possible_values = [1,2,3,4,5,6,7,8,9]
if value != '-':
possible_values = 'none'
cell = Cell(row, col, value, possible_values)
if row <= 2 and col <= 2:
cell.section = 0
elif row <= 2 and col <= 5:
cell.section = 1
elif row <= 2 and col <= 8:
cell.section = 2
elif row <= 5 and col <= 2:
cell.section = 3
elif row <= 5 and col <= 5:
cell.section = 4
elif row <=5 and col <= 8:
cell.section = 5
elif col <= 2:
cell.section = 6
elif col <= 5:
cell.section = 7
else:
cell.section = 8
cell.index = str(row) + ':' + str(col)
self.cell_list.append(cell)
示例2: create_cell
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import section [as 别名]
def create_cell(self, row, col, value):
possible_values = [1,2,3,4]
if value != '-':
possible_values = 'none'
cell = Cell(row, col, value, possible_values)
if row <= 1 and col <= 1:
cell.section = 0
elif row <= 1:
cell.section = 1
elif col <= 1:
cell.section = 2
else:
cell.section = 3
cell.index = str(row) + ':' + str(col)
self.cell_list.append(cell)
示例3: create_cell
# 需要导入模块: from cell import Cell [as 别名]
# 或者: from cell.Cell import section [as 别名]
def create_cell(self, row, col, value):
possible_values = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
cell = Cell(row, col, value, possible_values)
if row <= 3 and col <= 3:
cell.section = 0
elif row <= 3 and col <= 7:
cell.section = 1
elif row <= 3 and col <= 11:
cell.section = 2
elif row <= 3 and col <= 15:
cell.section = 3
elif row <= 7 and col <= 3:
cell.section = 4
elif row <= 7 and col <= 7:
cell.section = 5
elif row <= 7 and col <= 11:
cell.section = 6
elif row <= 7 and col <= 15:
cell.section = 7
elif row <= 11 and col <= 3:
cell.section = 8
elif row <= 11 and col <= 7:
cell.section = 9
elif row <= 11 and col <= 11:
cell.section = 10
elif row <= 11 and col <= 15:
cell.section = 11
elif col <= 3:
cell.section = 12
elif col <= 7:
cell.section = 13
elif col <= 11:
cell.section = 14
else:
cell.section = 15
cell.index = str(row) + ':' + str(col)
self.cell_list.append(cell)