Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/env/ python
- # -*- coding:utf-8 -*-
- import time
- import pystray
- icon = pystray.Icon('test name')
- from PIL import Image, ImageDraw
- color1 = "red"
- color2 = "blue"
- width = 10
- height = 10
- # Generate an image
- image = Image.new('RGB', (width, height), color1)
- dc = ImageDraw.Draw(image)
- dc.rectangle((width // 2, 0, width, height // 2), fill=color2)
- dc.rectangle((0, height // 2, width // 2, height), fill=color2)
- icon.icon = image
- def run(setup=icon):
- icon.visible = True
- icon.run() # wtf no icon no error :-V GRRR
- for i in range(10):
- time.sleep(1)
- print "waiting"
- icon.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement