Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. The following example from https://foxdot.org/documentation/using-the-tempoclock/
  2.  
  3. def update(key, bpm=None):
  4. Root.default = int(key)
  5. if bpm is not None:
  6. Clock.bpm = bpm
  7. return
  8.  
  9. # Schedule for 2 beats in the future
  10. Clock.schedule(update, Clock.now() + 2, args=[4], kwargs={"bpm", 120})
  11.  
  12.  
  13.  
  14.  
  15. produces the following output.
  16.  
  17. Welcome to FoxDot! Press Ctrl+H for help.
  18. -----------------------------------------
  19. >>> def update(key, bpm=None):
  20. ... Root.default = int(key)
  21. ... if bpm is not None:
  22. ... Clock.bpm = bpm
  23. ... return
  24. >>> # Schedule for 2 beats in the future
  25. ... Clock.schedule(update, Clock.now() + 2, args=[4], kwargs={"bpm", 120})
  26. Traceback (most recent call last):
  27. File "C:\Users\andre\AppData\Local\Programs\Python\Python36\lib\site-packages\FoxDot\lib\Code\main_lib.py", line 155, in __call__
  28. exec(self._compile(code), self.namespace)
  29. File "FoxDot", line 3, in <module>
  30. import os.path
  31. File "C:\Users\andre\AppData\Local\Programs\Python\Python36\lib\site-packages\FoxDot\lib\TempoClock.py", line 662, in schedule
  32. self.queue.add(obj, beat, args, kwargs, is_priority)
  33. File "C:\Users\andre\AppData\Local\Programs\Python\Python36\lib\site-packages\FoxDot\lib\TempoClock.py", line 765, in add
  34. for key in list(kwargs.keys()):
  35. AttributeError: 'set' object has no attribute 'keys'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement