def p_expression_derivative(p): '''expression : DERIVATIVE OF expression''' if s.find('^') != -1: eq = MathFunctions.formateq(p[3]) else: eq = str(p[3]) if p[3] is not None: eq = (str(MathFunctions.derivative(eq, MathFunctions.symbols('x')))) eq = MathFunctions.reformateq(eq) p[0] = eq w = tostring(asciimathml.parse('frac{d}{dx}')) y = tostring(asciimathml.parse(str(p[3]))) x = tostring(asciimathml.parse(str(p[0]))) print(str(w, "utf-8") + str(y, "utf-8") + "=" + str(x, "utf-8")) else: pass