def print_mexp(expr, protected_header_enabled=False, protected_header_prefix="X", **settings):
"""Print an expression to a MathML object.
:type protected_header_enabled: bool
:type protected_header_prefix: str
:param expr: The expression.
:param protected_header_enabled: Whether the protected headers are enabled.
:param protected_header_prefix: The prefix of the protected headers.
:param settings: The settings.
:rtype : bce.dom.mathml.all.Base
:return: The printed MathML object.
"""
# noinspection PyProtectedMember
return _MathMLPrinter(
settings,
protected_header_enabled=protected_header_enabled,
protected_header_prefix=protected_header_prefix
).doprint(_sympy.sympify(expr))
评论列表
文章目录