Reputation: 21
I am creating a kivy app in python. When I run the program in the text editor there is no error. But when I convert the file from .py to .exe using pyinstaller the following error is raised.
Window.fullscreen = "auto"
# AttributeError: 'NoneType' object has no attribute 'fullscreen'
How do I fix it?
Code:
from kivy.core.window import Window
Window.fullscreen = 'auto'
App.run()
I looked everywhere but didn't get an answer on how to fix the problem.
Upvotes: 0
Views: 882
Reputation: 1164
Before compiling your code to .exe, you can also run it using python your_app.py
. You are not going to see an error in your "text editor" (before running it) unless it's a typing error.
Anyway, your problem happens because you are trying to assign the value "auto" to "Window.fullscreen" before importing (which is why you are getting the NoneType error, as it doesn't exist yet)
You should do this instead:
from kivy.core.window import Window
Window.fullscreen = 'auto'
Do this before the App.run() method, and it should switch to fullscreen mode.
Upvotes: 1