本文整理汇总了Python中openpyxl.cell.Cell.is_date方法的典型用法代码示例。如果您正苦于以下问题:Python Cell.is_date方法的具体用法?Python Cell.is_date怎么用?Python Cell.is_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openpyxl.cell.Cell
的用法示例。
在下文中一共展示了Cell.is_date方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_date
# 需要导入模块: from openpyxl.cell import Cell [as 别名]
# 或者: from openpyxl.cell.Cell import is_date [as 别名]
def test_is_date():
wb = Workbook()
ws = Worksheet(wb)
cell = Cell(ws, 'A', 1)
cell.value = datetime.now()
assert cell.is_date() == True
cell.value = 'testme'
assert 'testme' == cell.value
assert cell.is_date() is False
示例2: test_is_date
# 需要导入模块: from openpyxl.cell import Cell [as 别名]
# 或者: from openpyxl.cell.Cell import is_date [as 别名]
def test_is_date():
wb = Workbook()
ws = Worksheet(wb)
cell = Cell(ws, "A", 1)
cell.value = datetime.now()
eq_(cell.is_date(), True)
cell.value = "testme"
eq_("testme", cell.value)
eq_(cell.is_date(), False)
示例3: test_is_not_date_color_format
# 需要导入模块: from openpyxl.cell import Cell [as 别名]
# 或者: from openpyxl.cell.Cell import is_date [as 别名]
def test_is_not_date_color_format():
wb = Workbook()
ws = Worksheet(wb)
cell = Cell(ws, 'A', 1)
cell.value = -13.5
cell.style = cell.style.copy(number_format=NumberFormat('0.00_);[Red]\(0.00\)'))
assert cell.is_date() is False
示例4: test_is_not_date_color_format
# 需要导入模块: from openpyxl.cell import Cell [as 别名]
# 或者: from openpyxl.cell.Cell import is_date [as 别名]
def test_is_not_date_color_format():
wb = Workbook()
ws = Worksheet(wb)
cell = Cell(ws, "A", 1)
cell.value = -13.5
cell.style.number_format.format_code = "0.00_);[Red]\(0.00\)"
eq_(cell.is_date(), False)