當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。