Python Forum
Send raw string via socket with out any changes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send raw string via socket with out any changes
#7
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....

(Jul-23-2019, 06:30 AM)john36 Wrote:
(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 Angel . I watched before only how see it python, not what he's send via socket.
I think, I too quickly found the problem solved

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
Reply


Messages In This Thread
RE: Send raw string via socket with out any changes - by john36 - Jul-24-2019, 09:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Send data BMP180 between client and server trought module socket smalhao 0 2,883 Jul-30-2018, 12:56 PM
Last Post: smalhao
  Simple send and recive string Server/Client Epilepsy 1 2,818 May-01-2018, 08:17 PM
Last Post: ThiefOfTime

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020