Z
Z
zhuchka052020-11-26 17:27:34
Python
zhuchka05, 2020-11-26 17:27:34

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.
5fbfba766f35e636140877.png
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

1 answer(s)
D
dooMoob, 2020-11-26
@dooMoob

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

Now look again at the code in the video and at your code, if you are careful enough, you will certainly see the difference

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question