1

How can i make string from a list which contains c_char types.

so for example the C code:

static const char data [] = {0x45, 'b', 'a'}

you can send it on socket.

I would like to do this in python. Is it possible? that is important, 1 element 1 byte.

1
  • Yes, it is possible. Commented Feb 5, 2015 at 15:58

1 Answer 1

0

You can use the python type bytearray to store your values and then send it directly over the socket:

Sending binary data over sockets with Python

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.