Python Forum
Can't strip extra characters from Data
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't strip extra characters from Data
#3
I put the line data = data.decode('utf-8') in my program to see what it would do and I see that it takes off the b' ' and just returns the GET / and the data with the & in the middle since I'm getting 2 string variables. What's the easiest way to strip off the GET / and extract the 2 strings to then so that I can then format them in another string to send off to another computer? First variable 10 characters, 2nd variable 3 characters. Also what command do I use to send off the data to another computer? Do I have to open a secondary socket to send that info or is there just a simple send command that would do that?

Thanks!!! on the data.decode suggestion. I had tried that before my submission to the forum here, but didn't know about putting the utf-8 or even what that code means.
Reply


Messages In This Thread
RE: Can't strip extra characters from Data - by Canflyguy - Jan-09-2022, 05:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  extract only text strip byte array Pir8Radio 7 3,442 Nov-29-2022, 10:24 PM
Last Post: Pir8Radio
Smile please help me remove error for string.strip() jamie_01 3 1,352 Oct-14-2022, 07:48 AM
Last Post: Pedroski55
  strip() pprod 8 3,785 Feb-16-2021, 01:11 PM
Last Post: buran
  Remove escape characters / Unicode characters from string DreamingInsanity 5 14,488 May-15-2020, 01:37 PM
Last Post: snippsat
  Need help with code for my WS2812B (Neopixel) Led Strip Phibbl 1 2,905 Apr-08-2020, 07:18 PM
Last Post: deanhystad
  split strip issues 'NonType' casacafe 8 4,146 Oct-08-2019, 06:29 PM
Last Post: ichabod801
  removing spaces/tabs after used .strip() zarize 0 1,672 Sep-11-2019, 12:46 PM
Last Post: zarize
  strip off just newlines Skaperen 11 5,644 Jun-19-2019, 06:28 PM
Last Post: Skaperen
  strip space from end of a row of text ineuw 4 3,057 Apr-15-2019, 03:14 AM
Last Post: ineuw
  How to remove whitespace from a string when .replace and .strip do not work winnetrie 7 4,697 Jan-05-2019, 08:44 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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