本文整理匯總了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)