parse-fmla.py 367 B

123456789101112
  1. from xlwt import ExcelFormulaParser, ExcelFormula
  2. import sys
  3. f = ExcelFormula.Formula(
  4. """ -((1.80 + 2.898 * 1)/(1.80 + 2.898))*
  5. AVERAGE((1.80 + 2.898 * 1)/(1.80 + 2.898);
  6. (1.80 + 2.898 * 1)/(1.80 + 2.898);
  7. (1.80 + 2.898 * 1)/(1.80 + 2.898)) +
  8. SIN(PI()/4)""")
  9. #for t in f.rpn():
  10. # print "%15s %15s" % (ExcelFormulaParser.PtgNames[t[0]], t[1])