Skip to content

Commit 5439e1c

Browse files
authored
Add files via upload
1 parent fad6962 commit 5439e1c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

texparse.py

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# -*- coding: utf-8 -*-
2+
3+
'''
4+
Example:
5+
>>> pr = mathEq.parseString('\\int_0^\\infty f(x) d x\\approx\\sum_{i=1}w_ie^{x_i}f(x_i)')
6+
>>> print(pr)
7+
[approx(int(f(x), x, 0, infty), sum(*(w_i, ^(e, x_i), f(x_i)), i, 1, infty))]
8+
'''
9+
210
from pyparsing import *
311
from pyparsing_ext import *
412

@@ -257,6 +265,7 @@ def __repr__(self):
257265
try:
258266
pr = mathEq.parseString('\\int_0^\\infty f(x) d x\\approx\\sum_{i=1}w_ie^{x_i}f(x_i)')
259267
print(pr)
268+
# [approx(int(f(x), x, 0, infty), sum(*(w_i, ^(e, x_i), f(x_i)), i, 1, infty))]
260269
except pp.ParseException as pe:
261270
print(pp.ParseException.explain(pe))
262271

0 commit comments

Comments
 (0)