import pystray
from PIL import Image
from importlib import reload
import os
import webbrowser
# Image for the tray
image = Image.open("image.png")
# Triggers for right click
def stop(icon, item):
icon.stop()
def ss(icon, item):
import discord
def edit(icon, item):
os.system('config.json')
def git(icon, item):
webbrowser.open('github')
def support(icon, item):
webbrowser.open('discord')
# Buttons for right click
icon = pystray.Icon("Hydisc", image, menu=pystray.Menu(
pystray.MenuItem("Start", ss),
pystray.MenuItem("Edit Settings", edit),
pystray.MenuItem("Github", git),
pystray.MenuItem("Support", support),
pystray.MenuItem("Quit", stop)
))
icon.run()
Files: https://i.stack.imgur.com/tORxl.png
I have image.png and tray.py in the same menu but when i run it PIL Image cant find the file heres the error: https://i.stack.imgur.com/XXwIE.png