コード例 #1
0
#!/usr/bin/env python
# tries stress SST, SAT and MSAT

import sys
from time import *
from poi import Workbook

#style = XFStyle()

wb = Workbook()
ws0 = wb.sheets.add('0')

colcount = 200 + 1
rowcount = 6000 + 1

t0 = time()
print "\nstart: %s" % ctime(t0)

print "Filling..."
for col in xrange(colcount):
    print "[%d]" % col,
    sys.stdout.flush()
    for row in xrange(rowcount):
        #ws0.write(row, col, "BIG(%d, %d)" % (row, col))
        ws0.cells(row, col).Value = "BIG"

t1 = time() - t0
print "\nsince starting elapsed %.2f s" % (t1)

print "Storing..."
wb.save('big-16Mb.xls')
コード例 #2
0
#!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman

from poi import Workbook, Borders, Font, Format

font0 = Font()
font0.Fontname = 'Times New Roman'
font0.StruckOut = True
font0.Bold = True

style0 = Format()
style0.Font = font0

wb = Workbook()
ws0 = wb.sheets.add('0')

ws0.cells(1, 1).Value = 'Test'
ws0.cells(1, 1).Format = style0

for i in range(0, 0x53):
    borders = Borders()
    borders.Left = i
    borders.Right = i
    borders.Top = i
    borders.Bottom = i

    ws0.cells(i, 2).Format.Borders = borders
    ws0.cells(i, 2).Format.Font = font0
    ws0.cells(i, 3).Value = hex(i)
    ws0.cells(i, 3).Format = ws0.cells(i, 2).Format
コード例 #3
0
ファイル: blanks.py プロジェクト: dabidan/pypoi
#!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman

from poi import Workbook, Borders, Font, Format

font0 = Font()
font0.Fontname = 'Times New Roman'
font0.StruckOut = True
font0.Bold = True

style0 = Format()
style0.Font = font0

wb = Workbook()
ws0 = wb.sheets.add('0')

ws0.cells(1, 1).Value='Test'
ws0.cells(1, 1).Format=style0

for i in range(0, 0x53):
    borders = Borders()
    borders.Left = i
    borders.Right = i
    borders.Top = i
    borders.Bottom = i

    ws0.cells(i,2).Format.Borders=borders
    ws0.cells(i,2).Format.Font=font0
    ws0.cells(i,3).Value=hex(i)
    ws0.cells(i,3).Format=ws0.cells(i,2).Format
コード例 #4
0
ファイル: big-16Mb.py プロジェクト: dabidan/pypoi
#!/usr/bin/env python
# tries stress SST, SAT and MSAT

import sys
from time import *
from poi import Workbook

#style = XFStyle()

wb = Workbook()
ws0 = wb.sheets.add('0')

colcount = 200 + 1
rowcount = 6000 + 1

t0 = time()
print "\nstart: %s" % ctime(t0)

print "Filling..."
for col in xrange(colcount):
    print "[%d]" % col,
    sys.stdout.flush() 
    for row in xrange(rowcount):
        #ws0.write(row, col, "BIG(%d, %d)" % (row, col))
        ws0.cells(row,col).Value = "BIG"

t1 = time() - t0
print "\nsince starting elapsed %.2f s" % (t1)

print "Storing..."
wb.save('big-16Mb.xls')
コード例 #5
0
#!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman

from poi import Workbook, Borders, Format, Font

wb = Workbook()
ws0 = wb.sheets.add('sheet0')

fnt1 = Font()
fnt1.Fontname = 'Verdana'
fnt1.Bold = True
fnt1.Height = 18

brd1 = Borders()
brd1.Left = 0x06
brd1.Right = 0x06
brd1.Top = 0x06
brd1.Bottom = 0x06

fnt2 = Font()
fnt2.Fontname = 'Verdana'
fnt2.Bold = True
fnt2.Height = 14

brd2 = Borders()
brd2.Left = 0x01
brd2.Right = 0x01
brd2.Top = 0x01
brd2.Bottom = 0x01
コード例 #6
0
ファイル: test.py プロジェクト: ruema/pypoi
            sys.stderr.write(l+'\n')
            wb=Workbook(path+l)
            for ws in wb.sheets:
                dump_sheet(ws,wb.sheets[ws])
            wb.save('test.xls')
            wb=Workbook('test.xls')
            for ws in wb.sheets:
                dump_sheet(ws,wb.sheets[ws])
        except int, e:
            print e

exit(0)
'''
                        
#wb=Workbook('/home/user/workspace/Queck/mso/poi-3.8/test-data/spreadsheet/StringContinueRecords.xls')
wb=Workbook('test.xls')
print wb.date1904
for ws in wb.sheets:
    dump_sheet(ws,wb.sheets[ws])
wb.save('test2.xls')
wb=Workbook('test2.xls')
dump_supbooks(wb)
#for ws in wb.sheets:
#    dump_sheet(ws,wb.sheets[ws])
exit(0)





    
コード例 #7
0
ファイル: big-35Mb.py プロジェクト: ruema/pypoi
#!/usr/bin/env python
# tries stress SST, SAT and MSAT

from time import *
from poi import Workbook

#style = XFStyle()

wb = Workbook()
ws0 = wb.sheets.add('0')

colcount = 200 + 1
rowcount = 6000 + 1

t0 = time()

for col in xrange(colcount):
    for row in xrange(rowcount):
        ws0.cells(row, col).Value="BIG(%d, %d)" % (row, col)

t1 = time() - t0
print "\nsince starting elapsed %.2f s" % (t1)

print "Storing..."
wb.save('big-35Mb.xls')

t2 = time() - t0
print "since starting elapsed %.2f s" % (t2)


コード例 #8
0
ファイル: merged1.py プロジェクト: dabidan/pypoi
#!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman

from poi import Workbook, Borders, Format, Font

wb = Workbook()
ws0 = wb.sheets.add('sheet0')

fnt1 = Font()
fnt1.Fontname = 'Verdana'
fnt1.Bold = True
fnt1.Height = 18

brd1 = Borders()
brd1.Left = 0x06
brd1.Right = 0x06
brd1.Top = 0x06
brd1.Bottom = 0x06

fnt2 = Font()
fnt2.Fontname = 'Verdana'
fnt2.Bold = True
fnt2.Height = 14

brd2 = Borders()
brd2.Left = 0x01
brd2.Right = 0x01
brd2.Top = 0x01
brd2.Bottom = 0x01
コード例 #9
0
ファイル: formulas.py プロジェクト: dabidan/pypoi
#!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman
from poi import Workbook

w = Workbook()
ws = w.sheets.add("F")

ws.cells(0, 0).Formula = "-(1+1)"
ws.cells(1, 0).Formula = "-(1+1)/(-2-2)"
ws.cells(2, 0).Formula = "-(134.8780789+1)"
ws.cells(3, 0).Formula = "-(134.8780789e-10+1)"
ws.cells(4, 0).Formula = "-1/(1+1)+9344"

ws.cells(0, 1).Formula = "-(1+1)"
ws.cells(1, 1).Formula = "-(1+1)/(-2-2)"
ws.cells(2, 1).Formula = "-(134.8780789+1)"
ws.cells(3, 1).Formula = "-(134.8780789e-10+1)"
ws.cells(4, 1).Formula = "-1/(1+1)+9344"

ws.cells(0, 2).Formula = "A1*$B1"
ws.cells(1, 2).Formula = "A2*B$2"
ws.cells(2, 2).Formula = "A3*$B$3"
ws.cells(3, 2).Formula = "A4*B4*sin(pi()/4)"
ws.cells(4, 2).Formula = "A5%*B5*pi()/1000"

##############
## NOTE: parameters are separated by semicolon!!!
##############

コード例 #10
0
ファイル: formulas.py プロジェクト: ruema/pypoi
#!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman
from poi import Workbook

w = Workbook()
ws = w.sheets.add('F')

ws.cells(0, 0).Formula = "-(1+1)"
ws.cells(1, 0).Formula = "-(1+1)/(-2-2)"
ws.cells(2, 0).Formula = "-(134.8780789+1)"
ws.cells(3, 0).Formula = "-(134.8780789e-10+1)"
ws.cells(4, 0).Formula = "-1/(1+1)+9344"

ws.cells(0, 1).Formula = "-(1+1)"
ws.cells(1, 1).Formula = "-(1+1)/(-2-2)"
ws.cells(2, 1).Formula = "-(134.8780789+1)"
ws.cells(3, 1).Formula = "-(134.8780789e-10+1)"
ws.cells(4, 1).Formula = "-1/(1+1)+9344"

ws.cells(0, 2).Formula = "A1*$B1"
ws.cells(1, 2).Formula = "A2*B$2"
ws.cells(2, 2).Formula = "A3*$B$3"
ws.cells(3, 2).Formula = "A4*B4*sin(pi()/4)"
ws.cells(4, 2).Formula = "A5%*B5*pi()/1000"

##############
## NOTE: parameters are separated by semicolon!!!
##############

ws.cells(