I
I
Igor Korobko2016-04-25 10:02:16
Python
Igor Korobko, 2016-04-25 10:02:16

How to unload styles (fonts, colors) when uploading data to excel?

Load data into Excel (Google Docs) using a script. How to change the color, font of the uploaded fields when uploading data?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2016-04-25
@fox_12

For example like this:
pythonhosted.org/xlutils/styles.html
or like this:

import xlwt
from datetime import datetime

style0 = xlwt.easyxf('font: name Times New Roman, color-index red, bold on',
    num_format_str='#,##0.00')
style1 = xlwt.easyxf(num_format_str='D-MMM-YY')

wb = xlwt.Workbook()
ws = wb.add_sheet('A Test Sheet')

ws.write(0, 0, 1234.56, style0)
ws.write(1, 0, datetime.now(), style1)
ws.write(2, 0, 1)
ws.write(2, 1, 1)
ws.write(2, 2, xlwt.Formula("A3+B3"))

wb.save('example.xls')

I
Igor Korobko, 2016-04-25
@nekto007

Unloads tables in Googledox in the form:a85b8784650440239e0b94b7f7c1e821.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question