Synchronous and Asynchronous callbacks

2019-09-28 Thread Eko palypse
Hello, I'm looking for a solution to a problem which is described best as an observer pattern issue I guess. The scenario is the following, client code can register a callback for one or a list of notifications. This is currently solved by having a dictionary with the possible notifications as

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-28 Thread RobH
On 28/09/2019 15:59, Dennis Lee Bieber wrote: On Fri, 27 Sep 2019 19:46:58 +0100, RobH declaimed the following: Thanks for all that information, but first of all using just import adafruit blinka did not work as it returned bas: import: command not found. Were you in the Python3 in

Re: ypeError: decoding str is not supported

2019-09-28 Thread Paul Moore
On Sat, 28 Sep 2019 at 10:53, Peter Otten <__pete...@web.de> wrote: > > Hongyi Zhao wrote: > > > Hi, > > > > I have some code comes from python 2 like the following: > > > > str('a', encoding='utf-8') > > This fails in Python 2 > > >>> str("a", encoding="utf-8") > Traceback (most recent call last):

Re: ypeError: decoding str is not supported

2019-09-28 Thread Peter Otten
Hongyi Zhao wrote: > Hi, > > I have some code comes from python 2 like the following: > > str('a', encoding='utf-8') This fails in Python 2 >>> str("a", encoding="utf-8") Traceback (most recent call last): File "", line 1, in TypeError: str() takes at most 1 argument (2 given) ...unless yo

ypeError: decoding str is not supported

2019-09-28 Thread Hongyi Zhao
Hi, I have some code comes from python 2 like the following: str('a', encoding='utf-8') But for python 3, this will fail as follows: >>> str('a', encoding='utf-8') Traceback (most recent call last): File "", line 1, in TypeError: decoding str is not supported How to fix it? -- https://m