def handler(message): print(List.to_string(list(message)[0])) Lol = list(map(lambda x: List.to_string(x), list(message))) print(Lol) updateGrid(gridArray, Lol) drawGridAux() pygame.display.flip()
def decode_string(self, string: ErlangList): """Decodes for Python a string sent from Erlang (seen as a list, yet known to actually be a string). Erlang and ErlPort treat lists and strings the same way. However, the Python 'List' class, into which ErlPort turns Erlang lists, provides a 'to_string' method. Thus, one can make use of this method whenever one knows that a list received from Erlang corresponds actually to a string. """ return string.to_string()