I am new to the kivy GUI package and wanted to learn to make a game by following the 'Pong Game Tutorial' on the official site. I entered the basic code to open up a GUI window which worked just fine. However when I close this window and rerun the same code again I get an ArgumentError. I am using the latest version of Spyder as IDE and have updated all packages.
The only thing that circumvents this problem is restarting Spyder. Am I doing something wrong in the execution?
The code should open up a new window every time it is executed. After the first run I get this console output however which ends in an ArgumentError.
The Code:
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()
The console output
[INFO ] [Base ] Start application main loop
[ERROR ] [Base ] No event listeners have been created
[ERROR ] [Base ] Application will leave
[INFO ] [Base ] Leaving application in progress...
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "<ipython-input-2-30ebdb31c7db>", line 17, in <module>
PongApp().run()
File "C:\Users\almig\Anaconda3\lib\site-packages\kivy\app.py", line 855, in run
runTouchApp()
File "C:\Users\almig\Anaconda3\lib\site-packages\kivy\base.py", line 506, in runTouchApp
stopTouchApp()
File "C:\Users\almig\Anaconda3\lib\site-packages\kivy\base.py", line 521, in stopTouchApp
EventLoop.close()
File "C:\Users\almig\Anaconda3\lib\site-packages\kivy\base.py", line 172, in close
self.stop()
File "C:\Users\almig\Anaconda3\lib\site-packages\kivy\base.py", line 184, in stop
provider.stop()
File "C:\Users\almig\Anaconda3\lib\site-packages\kivy\input\providers\wm_pen.py", line 111, in stop
SetWindowLong_WndProc_wrapper(self.hwnd, self.old_windProc)
File "C:\Users\almig\Anaconda3\lib\site-packages\kivy\input\providers\wm_common.py", line 122, in _closure
oldAddr = func(hWnd, GWL_WNDPROC, cast(wndProc, c_void_p).value)
ArgumentError: argument 3: <class 'TypeError'>: wrong type