'how to see number of each line in text input of kivy?

There are some text editing softwares that show us the number of lines in order.

like this:

enter image description here

I want to have this effect in text input of kivy but i do not know how can i implement it.

code:

import kivy
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.textinput import TextInput


class MyApp(App):

    def build(self):
        layout = FloatLayout( )
        t=TextInput(size_hint=(1,.4))
        layout.add_widget(t)
        return layout




    


if __name__ == '__main__':
    MyApp().run()

I thought i can do this with adding a hint_text to text input like this:

t=TextInput(size_hint=(1,.4),hint_text='1')

But the problem is when i press enter to go to the next line the text of hint_text disappears. I do not want the text of hint_text to be disappear after pressing enter how can i do that?

Or if there is a better way to implement this effect what is it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source