Reputation: 11
I am trying to make a small weather app. Everything going perfect with my codes, except when i used this code to have a systray icon:
from pystray import MenuItem as item
import pystray
def quit_window(icon, item):
icon.stop()
main.destroy()
def show_window(icon, item):
icon.stop()
main.after(0,main.deiconify)
def withdraw_window():
main.withdraw()
image = Image.open("logo2.ico")
menu = (item('Show', show_window), item('Quit', quit_window))
icon = pystray.Icon("weather app", image, "weather app", menu)
icon.run()
main.protocol('WM_DELETE_WINDOW', withdraw_window)
And i tried to make my app as a stand alone application by using py2exe. When i finished exporting my app to exe and tried to start it i got this error:
Traceback (most recent call last):
File "Weather-V102.pyw", line 9, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pystray\__init__.pyc", line 48, in <module>
File "pystray\__init__.pyc", line 40, in backend
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
any one can help me with this how to solve it. Thanks for your help
Upvotes: 1
Views: 69