I\'ve been trying to build something with kivy, but whenever I try to load a different in a directory, it says that the program isn\'t found in the directory, when I\'m sure it\
Not a direct answer, but a possible work around:
from kivy.lang import Builder
Builder.load_file('./my_custom_file.kv')
Alternatively you can try loading the string manually and forget (delete) the kv file entirely.
from kivy.lang import Builder
Builder.load_string('''
<PongGame>:
canvas:
Rectangle:
pos: self.center_x - 5, 0
size: 10, self.height
Label:
font_size: 70
center_x: root.width / 4
top: root.top - 50
text: "0"
Label:
font_size: 70
center_x: root.width * 3 / 4
top: root.top - 50
text: "0"
''')
If you want to continue using the pong.kv file I also suggest renaming the main app class to PongApp
. I am unsure if it has any effect but it's worth a shot.
Check the .kv filename. If you create the file in the IDE, it will make it 'filename.kv.py'.
Maybe because the name of your python class is pongGame and in the kv file it's called (Capital P versus lower p)
According to the python style guide the class should be with a Capital P.