Problem with delimiters - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Problem with delimiters (/thread-24042.html) |
Problem with delimiters - johnprada - Jan-28-2020 Hello everyone I am quite stuck. i am trying to get a message from a TCP communication protocol, this message is converted in a list of strings and then into a list of float, The thing is that im getting an error because of the delimiters. here is my code while True: message = conn.recv(BUFFER_SIZE) if not message: break t1 = time.time() message = message.decode("utf-8") print("Raw message: {}".format(message)) data = list(message.split(",")) print("Data Size:{} ".format(len(data))) MyNewData = [] for item in data: MyNewData.append(float(item)) print("The new list: {}".format(MyNewData)) # data = list(map(float,message.split(","))) print("Size:{} ".format(len(data))) RE: Problem with delimiters - buran - Jan-28-2020 now, if you post the raw message from line 8.... we may be able to help
|