Sry but you don't understand my question:
I have def routine, this routine return different string for example variable = '\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\...'
And in the next step i want sent this variable as binary data I cant do how did you write variable = b'\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\...' becose i didn't know yet how will be look like this variable, I will be have many different data \xab\xcd\xef\xgh....
I need to making my received variables to binary data and then send. But my sequence looks like below:
1. I get raw data from data base,
2. I transform this raw db data to string db_data = '\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\...'
3. I want transform this db_data string to binary without encoding(and any different change) --> binary_data_ready_to_sent
4. In last step I want sent this via socket
I have def routine, this routine return different string for example variable = '\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\...'
And in the next step i want sent this variable as binary data I cant do how did you write variable = b'\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\...' becose i didn't know yet how will be look like this variable, I will be have many different data \xab\xcd\xef\xgh....
(Jul-23-2019, 06:30 AM)john36 Wrote:I think, I too quickly found the problem solved(Jul-21-2019, 08:55 PM)john36 Wrote: thanks for Your help, i will try Your advise in Tuesday, because now I'm in home and this labeler machine is far away.
ok, it's working . I watched before only how see it python, not what he's send via socket.
I need to making my received variables to binary data and then send. But my sequence looks like below:
1. I get raw data from data base,
2. I transform this raw db data to string db_data = '\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\...'
3. I want transform this db_data string to binary without encoding(and any different change) --> binary_data_ready_to_sent
4. In last step I want sent this via socket