Ejemplo n.º 1
0
def get_data_in_excel(path_image):  # 生成CSS文件
    CSS_Text = "@charset \"UTF-8\";\n/* CSS Document */\n"
    get_data(path_image)
    print("result.xls生成")
    path_excel = "../excel/result.xls"
    line_count = 2  # 行数
    result_rows = excel.get_excel_rows(path_excel)  # 获取result.xls最大行数
    while line_count <= result_rows:
        CSS_Text += '.'
        CSS_Text += excel.read_excel_xls(path_excel, line_count - 1, 0) + '{\n'
        CSS_Text += excel.read_excel_xls(path_excel, line_count - 1, 1)
        CSS_Text += excel.read_excel_xls(path_excel, line_count - 1, 2)
        CSS_Text += excel.read_excel_xls(path_excel, line_count - 1, 3)
        CSS_Text += excel.read_excel_xls(path_excel, line_count - 1,
                                         4) + "\n}\n"
        line_count += 1
    return CSS_Text
Ejemplo n.º 2
0
def create_html():
    path_excel = "../excel/result.xls"
    line_count = 2  # 行数
    result_rows = excel.get_excel_rows(path_excel)  # 获取result.xls最大行数
    source_code = HTML.HTML.meta + HTML.HTML.next_line  # 声明
    source_code += HTML.HTML.html + HTML.HTML.next_line + HTML.HTML.find_your_another_one(
        HTML.HTML.html)
    title = HTML.HTML.next_line + HTML.HTML.title + HTML.HTML.next_line + \
                   excel.read_excel_xls(path_excel, 1, 5)  + HTML.HTML.next_line +\
                   HTML.HTML.find_your_another_one(HTML.HTML.title) +\
            HTML.HTML.next_line # 写入title
    head = HTML.HTML.next_line + HTML.HTML.head + \
           HTML.HTML.next_line + HTML.HTML.find_your_another_one(HTML.HTML.head) # 生成head
    css_state = HTML.HTML.split_detail(
        "<link", HTML.HTML.link, "rel=\"stylesheet\" "
        "type=\"text/css\" href=\"../css/test.css\"")  # 生成CSS声明
    head = HTML.HTML.split_detail(HTML.HTML.head, head, title + css_state)
    body = HTML.HTML.body + HTML.HTML.find_your_another_one(HTML.HTML.body)
    div_block = ""
    while line_count <= result_rows:
        class_name = excel.read_excel_xls(path_excel, line_count - 1, 0)
        text = excel.read_excel_xls(path_excel, line_count - 1, 5)
        temp = HTML.HTML.split_detail(
            "<div", HTML.HTML.div,
            HTML.HTML.class_name + "=\"" + class_name + "\"")
        div_block += (temp + HTML.HTML.next_line + text + HTML.HTML.next_line +
                      HTML.HTML.find_your_another_one(HTML.HTML.div) +
                      HTML.HTML.next_line)
        line_count += 1
    body = HTML.HTML.next_line + HTML.HTML.split_detail(
        HTML.HTML.body, body, div_block)
    head_body = head + body
    source_code = HTML.HTML.split_detail(HTML.HTML.html, source_code,
                                         head_body)
    return source_code


# create_html()
Ejemplo n.º 3
0
def level(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 0)
Ejemplo n.º 4
0
def text(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 11)
Ejemplo n.º 5
0
def conf(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 10)
Ejemplo n.º 6
0
def height(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 9)
Ejemplo n.º 7
0
def width(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 8)
Ejemplo n.º 8
0
def top(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 7)
Ejemplo n.º 9
0
def left(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 6)
Ejemplo n.º 10
0
def word_num(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 5)
Ejemplo n.º 11
0
def line_num(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 4)
Ejemplo n.º 12
0
def par_num(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 3)
Ejemplo n.º 13
0
def block_num(i):
    return excel.read_excel_xls(path + book_name_xls, i - 1, 2)