本文整理汇总了Python中dirigible.sheet.worksheet.Worksheet.cell_range方法的典型用法代码示例。如果您正苦于以下问题:Python Worksheet.cell_range方法的具体用法?Python Worksheet.cell_range怎么用?Python Worksheet.cell_range使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dirigible.sheet.worksheet.Worksheet
的用法示例。
在下文中一共展示了Worksheet.cell_range方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mixed_parameters
# 需要导入模块: from dirigible.sheet.worksheet import Worksheet [as 别名]
# 或者: from dirigible.sheet.worksheet.Worksheet import cell_range [as 别名]
def test_mixed_parameters(self):
ws = Worksheet()
cell_range = ws.cell_range((10, 10),'C4')
self.assertEquals(cell_range.left, 3)
self.assertEquals(cell_range.top, 4)
self.assertEquals(cell_range.right, 10)
self.assertEquals(cell_range.bottom, 10)
try:
_ = ws.cell_range('wipple',(1,2))
self.fail('should raise ValueError')
except ValueError, e:
self.assertEquals(str(e), "wipple is not a valid cell location")
示例2: test_single_string_parameter_uses_formula_notation
# 需要导入模块: from dirigible.sheet.worksheet import Worksheet [as 别名]
# 或者: from dirigible.sheet.worksheet.Worksheet import cell_range [as 别名]
def test_single_string_parameter_uses_formula_notation(self):
ws = Worksheet()
cell_range = ws.cell_range('A2:C4')
self.assertEquals(cell_range.left, 1)
self.assertEquals(cell_range.top, 2)
self.assertEquals(cell_range.right, 3)
self.assertEquals(cell_range.bottom, 4)
try:
_ = ws.cell_range('A1:wibble')
self.fail('should raise ValueError')
except ValueError, e:
self.assertEquals(str(e), "Invalid cell range 'A1:wibble'")
示例3: test_double_string_parameters_use_a1_notation
# 需要导入模块: from dirigible.sheet.worksheet import Worksheet [as 别名]
# 或者: from dirigible.sheet.worksheet.Worksheet import cell_range [as 别名]
def test_double_string_parameters_use_a1_notation(self):
ws = Worksheet()
cell_range = ws.cell_range('A2','C4')
self.assertEquals(cell_range.left, 1)
self.assertEquals(cell_range.top, 2)
self.assertEquals(cell_range.right, 3)
self.assertEquals(cell_range.bottom, 4)
try:
_ = ws.cell_range('wabble','C4')
self.fail('should raise ValueError')
except ValueError, e:
self.assertEquals(str(e), "wabble is not a valid cell location")
示例4: test_two_tuple_parameters
# 需要导入模块: from dirigible.sheet.worksheet import Worksheet [as 别名]
# 或者: from dirigible.sheet.worksheet.Worksheet import cell_range [as 别名]
def test_two_tuple_parameters(self):
ws = Worksheet()
cell_range = ws.cell_range((2, 3), (5, 4))
self.assertEquals(cell_range.left, 2)
self.assertEquals(cell_range.top, 3)
self.assertEquals(cell_range.right, 5)
self.assertEquals(cell_range.bottom, 4)