I have the following snippet of code that works just fine under Python 2.7 but gives errors in Python 3.4:
I'm a noob at Python and Kivy. I'm just experimenting writing a little demo and trying to learn. When I run this with Python 3.4, I get an error.
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Jon Martin\mischief\__main__.py", line 6, in <module>
with game.GameApp():
File "C:\Users\Jon Martin\mischief\game.py", line 65, in __enter__
self.run()
File "C:\Python34\lib\site-packages\kivy\app.py", line 802, in run
root = self.build()
File "C:\Users\Jon Martin\mischief\game.py", line 110, in build
return GameWidget()
File "C:\Python34\lib\site-packages\kivy\uix\floatlayout.py", line 65, in __init__
super(FloatLayout, self).__init__(**kwargs)
File "C:\Python34\lib\site-packages\kivy\uix\layout.py", line 72, in __init__
super(Layout, self).__init__(**kwargs)
File "C:\Python34\lib\site-packages\kivy\uix\widget.py", line 320, in __init__
Builder.apply(self, ignored_consts=self._kwargs_applied_init)
File "C:\Python34\lib\site-packages\kivy\lang.py", line 1970, in apply
self._apply_rule(widget, rule, rule, ignored_consts=ignored_consts)
File "C:\Python34\lib\site-packages\kivy\lang.py", line 2082, in _apply_rule
child = cls(__no_builder=True)
File "C:\Users\Jon Martin\mischief\renderer.py", line 77, in __init__
self.setup_scene()
File "C:\Users\Jon Martin\mischief\renderer.py", line 124, in setup_scene
self.add_many_monkeys()
File "C:\Users\Jon Martin\mischief\renderer.py", line 216, in add_many_monkeys
mode=bytes('triangles','ASCII'),
File "kivy\graphics\vertex_instructions.pyx", line 385, in kivy.graphics.vertex_instructions.Mesh.__init__ (kivy\graphics\vertex_instructions.c:20900)
File "kivy\graphics\vertex.pyx", line 50, in kivy.graphics.vertex.VertexFormat.__init__ (kivy\graphics\vertex.c:1129)
TypeError: expected bytes, str found
I still get the same error.
I apologize if this is totally obvious, but could someone please tell me what I'm misunderstanding?!