Answer the question
In order to leave comments, you need to log in
Python program won't start, how to solve?
I am writing my first game and a program in Python in general. I wrote from a video from YouTube (the code is not written completely, but it should start for sure, because everything worked for the person from the video with the same incomplete code). I did everything as the code was completely written off. But when I run the program, this thing crashes.
There should be a ping pong table (a black background and a white strip in the middle and two zeros on the sides)
here is the code and the second part, in fact, where this strip and zeros are drawn
from kivy.app import App
from kivy.uix.widget import Widget
class PongGame(Widget):
pass
class PongApp(App):
def build(self):
return PongGame()
if __name__ == '__main__':
PongApp().run()
<code lang="python">
#:kivy 1.11.1
<PongGame>:
canvas:
Rectangle:
##Бордюр
pos: self.centre_x - 5, 0
size: 10, self.height
Label:
##Очки левого
font_size: 70
centre_x: root.width / 4
top: root.top - 50
text: "0"
Labe:
##Очки правого
font_size: 70
centre_x: root.width * 3 / 4
top: root.top - 50
text: "0"
</code>
Answer the question
In order to leave comments, you need to log in
the code is not completely written, but it should run for sure, because everything worked for the person from the video with the same incomplete code. I did
everything as it was, the code was completely written off
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question