Python Forum
[Kivy] Program ending unexpectedly without output
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Kivy] Program ending unexpectedly without output
#1
Hello!
I just started learning to use kivy. I copied an example from the docs into nano, but it doesn't show any output and terminates on its own.

Here is the code:

import kivy
kivy.require ('1.10.1')

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput

class Login(GridLayout):
	def __init__(self, **kwargs):
		super(Login, self).__init__(**kwargs)
		self.cols = 2
		self.add_widget(Label(text='Username'))
		self.username = TextInput(multiline=False)
		self.add_widget(self.username)
		self.add_widget(Label(text='Password'))
		self.password = TextInput(multiline=False, password=True)
		self.add_widget(self.password)


class MyApp(App):
	def build(self):
		return Login()
#        return Label(text='Hello world!')

if __name__ == '__main__':
	MyApp().run()
the output in the console is the following:
Output:
[INFO ] [Logger ] Record log in /home/comp/.kivy/logs/kivy_18-11-09_6.txt [INFO ] [Kivy ] v1.10.1 [INFO ] [Python ] v3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0] [INFO ] [Factory ] 194 symbols loaded [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored) [INFO ] [Text ] Provider: pil(['text_sdl2'] ignored)
where am i making the mistake?? Huh
Reply


Messages In This Thread
Program ending unexpectedly without output - by test - Nov-09-2018, 02:35 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020