ami_excel.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:ami-tools 作者: NYPL 项目源码 文件源码
def check_noequations(self):
    """
    Verify that no column in a sheet contains an equation
    Based on checking every cell in the 4th row

    Keyword arguments:
    sheet -- sheet object from workbook
    """
    wb_open = load_workbook(self.path, read_only = True)
    sheet = wb_open.get_sheet_by_name(self.name)

    for i in range(1, len(self.header_entries)):
      for j in range(1,5):
        value = sheet.cell(row = j, column = i).value
        # equation check logic, TODO might be better code out there
        if (value and isinstance(value, str) and value[0] == "="):
          raise AMIExcelError("Cell R4C{0} contain equations."
            .format(i))

    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号