当前位置: 首页>>代码示例>>Python>>正文


Python Worksheet.cell_range方法代码示例

本文整理汇总了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")
开发者ID:bwhmather,项目名称:dirigible-spreadsheet,代码行数:15,代码来源:test_worksheet.py

示例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'")
开发者ID:bwhmather,项目名称:dirigible-spreadsheet,代码行数:15,代码来源:test_worksheet.py

示例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")
开发者ID:bwhmather,项目名称:dirigible-spreadsheet,代码行数:15,代码来源:test_worksheet.py

示例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)
开发者ID:bwhmather,项目名称:dirigible-spreadsheet,代码行数:9,代码来源:test_worksheet.py


注:本文中的dirigible.sheet.worksheet.Worksheet.cell_range方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。