KEY_BLANK was going to be an alias of icon_solid, but instead decided to make it a constant to make things more efficient
-
-
Replying to @cMadan @spinicist and
I can't speak to the efficiency to be honest without getting to grips with your code more. But why are you using globals instead of a class?
2 replies 0 retweets 2 likes -
It is common and fine to use module-level constants. Advice against globals is about not writing to globals.
2 replies 0 retweets 1 like -
Replying to @michaelhoffman @o_guest and
Right, I definitely am not going to define anything as a global, just want some module level constants instead of hardcoding those values
1 reply 0 retweets 0 likes -
I do agree think a object-oriented interface would be more natural than passing an elg handle all over the place.
2 replies 0 retweets 3 likes -
Replying to @michaelhoffman @cMadan and
Once you figure that out, I'd suggest your class should act as a context manager so you can use it in a with block.https://www.python.org/dev/peps/pep-0343/ …
2 replies 1 retweet 2 likes -
Replying to @michaelhoffman @cMadan and
The Deck.__exit__() function should call close() on your hid object.
2 replies 0 retweets 3 likes -
Replying to @michaelhoffman @cMadan and
(implement this and you'll see how powerful the OO approach can be in Python)
1 reply 1 retweet 1 like -
Replying to @neuromusic @michaelhoffman and
Yeah, it's extremely powerful and you learn really good SE skills. Don't forget some unit tests too. https://docs.python.org/3/library/unittest.html …
1 reply 0 retweets 0 likes -
Replying to @o_guest @neuromusic and
Fyi. I rewrote the module to be a class now :)
1 reply 0 retweets 2 likes
Nice progress!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.