summaryrefslogtreecommitdiff
path: root/tablib/packages/xlwt/examples/parse-fmla.py
blob: 81a8d001b9891be2c9d9f0e420a19b7ce1def25d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
from xlwt import ExcelFormulaParser, ExcelFormula
import sys

f = ExcelFormula.Formula(
""" -((1.80 + 2.898 * 1)/(1.80 + 2.898))*
AVERAGE((1.80 + 2.898 * 1)/(1.80 + 2.898); 
        (1.80 + 2.898 * 1)/(1.80 + 2.898); 
        (1.80 + 2.898 * 1)/(1.80 + 2.898)) + 
SIN(PI()/4)""")

#for t in f.rpn():
#    print "%15s %15s" % (ExcelFormulaParser.PtgNames[t[0]], t[1])