小编Era*_*aph的帖子

如何使用 xlrd 版本 1.1.0 读取 Excel 中的字体和背景颜色

实际上我使用的是xlrd模块1.1.0版本,但我不知道如何读取单元格属性,如背景颜色、字体以及单元格是否被锁定。

我尝试使用

import xlrd
book = xlrd.open_workbook("sample.xls", formatting_info=True)
sheets = book.sheet_names()
print "sheets are:", sheets
for index, sh in enumerate(sheets):
    sheet = book.sheet_by_index(index)
    print "Sheet:", sheet.name
    rows, cols = sheet.nrows, sheet.ncols
    print "Number of rows: %s   Number of cols: %s" % (rows, cols)
    for row in range(rows):
        for col in range(cols):
            print "row, col is:", row+1, col+1,
            thecell = sheet.cell(row, col)      
            # could get 'dump', 'value', 'xf_index'
            print thecell.value,
            xfx = sheet.cell_`enter code here`xf_index(row, col)
            xf = book.xf_list[xfx]
            bgx = …
Run Code Online (Sandbox Code Playgroud)

python xlrd

4
推荐指数
1
解决办法
5357
查看次数

在 Oracle 过程中声明表变量

我有很多时间试图找到一个这样做的例子。我有一个过程,作为该过程的一部分,我想存储 SELECT 语句的结果,以便我可以针对该集合进行操作,然后将其用作参考以在全部完成后更新原始记录。

我遇到的困难在于声明临时表变量。这是我正在尝试做的一个例子:

PROCEDURE my_procedure
IS
  output_text clob;
  temp_table IS TABLE OF MY_TABLE%ROWTYPE; -- Error on this line
BEGIN
  SELECT * BULK COLLECT INTO temp_table FROM MY_TABLE WHERE SOME_DATE IS NULL;

  -- Correlate results into the clob for sending to email (working)
  -- Set the SOME_DATE value of the original record set where record is in temp_table
Run Code Online (Sandbox Code Playgroud)

第二次出现 时出现错误IS,说这是一个意外符号。这向我表明我的表变量声明要么是错误的,要么是在错误的地方。我试过在DECLARE之后将它放入一个块中BEGIN,但我又遇到了另一个错误。

这个声明应该去哪里?或者,如果有更好的解决方案,我也会采纳!

oracle

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

oracle ×1

python ×1

xlrd ×1