Dec-04-2020, 09:07 AM
Hi
I am trying to send json data over a pipe but cannot get it quite right
Send
[error
TypeError: string indices must be integers
[/error]
What is the correct way of doing this?
I am trying to send json data over a pipe but cannot get it quite right
Send
mesages = [{"id": "1", "txt": "message 1", "start_date": "2014-02-09", "start_time": "16:20", "duration": "01:00"}] win32file.WriteFile(handle, str.encode(json.dumps(mesages), encoding="ascii"))receive
result, data = win32file.ReadFile(p, 65535) json_data = json.dumps(data.decode('ascii')) print(json_data['first_name'])This gives me this error
[error
TypeError: string indices must be integers
[/error]
What is the correct way of doing this?