m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
466 B

6 months ago
  1. from sympy.printing.mathml import mathml
  2. from sympy.utilities.mathml import c2p
  3. import tempfile
  4. import subprocess
  5. def print_gtk(x, start_viewer=True):
  6. """Print to Gtkmathview, a gtk widget capable of rendering MathML.
  7. Needs libgtkmathview-bin"""
  8. with tempfile.NamedTemporaryFile('w') as file:
  9. file.write(c2p(mathml(x), simple=True))
  10. file.flush()
  11. if start_viewer:
  12. subprocess.check_call(('mathmlviewer', file.name))