infissa.py 666 B

1234567891011121314151617181920212223242526272829303132
  1. from subprocess import Popen, PIPE
  2. class Giappo:
  3. def __init__(self, symbol):
  4. self.s = symbol
  5. def __xor__(self, other):
  6. return Giappo(self.s + other.s)
  7. def __add__(self, other):
  8. if other == [o_o]:
  9. return Musicona('883.mp4')
  10. class Musicona:
  11. def __init__(self, url):
  12. self.url = url
  13. def __eq__(self, other):
  14. if other == 883:
  15. p = Popen(['mplayer', '-fs', self.url], stdout=PIPE, stderr=PIPE)
  16. p.communicate()
  17. class Musicassetta:
  18. def __init__(self):
  19. pass
  20. d = Giappo('d')
  21. b = Giappo('b')
  22. _ = Giappo('_')
  23. o_o = Musicassetta()
  24. __all__ = ['d', '_', 'b', 'o_o']