/usr/share/pyshared/sympy/printing/gtk.py is in python-sympy 0.7.1.rc1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | from sympy.printing.mathml import mathml
import tempfile
import os
def print_gtk(x, start_viewer=True):
"""Print to Gtkmathview, a gtk widget capable of rendering MathML.
Needs libgtkmathview-bin"""
from sympy.utilities.mathml import c2p
tmp = tempfile.mktemp() # create a temp file to store the result
file = open(tmp, 'wb')
file.write( c2p(mathml(x), simple=True) )
file.close()
if start_viewer:
os.system("mathmlviewer " + tmp)
|