Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #!/usr/local/env/ python
  2. # -*- coding:utf-8 -*-
  3.  
  4. import time
  5. import pystray
  6.  
  7. icon = pystray.Icon('test name')
  8.  
  9.  
  10. from PIL import Image, ImageDraw
  11. color1 = "red"
  12. color2 = "blue"
  13.  
  14. width = 10
  15. height = 10
  16.  
  17. # Generate an image
  18. image = Image.new('RGB', (width, height), color1)
  19. dc = ImageDraw.Draw(image)
  20. dc.rectangle((width // 2, 0, width, height // 2), fill=color2)
  21. dc.rectangle((0, height // 2, width // 2, height), fill=color2)
  22.  
  23. icon.icon = image
  24.  
  25. def run(setup=icon):
  26. icon.visible = True
  27.  
  28. icon.run() # wtf no icon no error :-V GRRR
  29.  
  30. for i in range(10):
  31. time.sleep(1)
  32. print "waiting"
  33.  
  34. icon.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement