show math output result in kivy label or textinput

53 views
Skip to first unread message

Degenerate Tech

unread,
Nov 3, 2021, 1:38:00 PM11/3/21
to Kivy users support
how to load beautiful math expression of sympy in kivy textinput or label
from __future__ import division
from sympy import *

from kivy.app import App
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button


class MyApp(App):

    def f(self):
        
        
        x, y, z, t = symbols('x y z t')
        k, m, n = symbols('k m n', integer=True)
        f, g, h = symbols('f g h', cls=Function)

        
        x = symbols('x')
        a = Integral(cos(x)*exp(x), x)
        c=Eq(a, a.doit())
        init_printing(use_unicode=True) 
        pprint(c)
        return  c
    def build(self):
        return TextInput(text=str(self.f()).encode('utf-8'))



MyApp().run()
Reply all
Reply to author
Forward
0 new messages