Python Forum
lists, strings, and byte strings
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
lists, strings, and byte strings
#3
right, iterating over bytes or a bytearray gets a list of ints. and doing so over a string gets a list of strings that are each len() == 1. either of these is easy enough to do and it is easy enough for the same code to do it. but reversing it back is harder, and doing it with the same code is even harder, still. it's the reversing step i want to do. one ambiguity is bytes vs bytearray in python3. given a list of ints, you don't know which to go back to. i'll accept bytearray because it is available in both python2 and python3. btw, the code i seek that can reverse a list back to a string or bytearray, i want it to be the same code working in both python2 and python3 ... python version agnostic code.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
lists, strings, and byte strings - by Skaperen - Mar-01-2018, 01:44 AM
RE: lists, strings, and byte strings - by DeaD_EyE - Mar-01-2018, 02:10 AM
RE: lists, strings, and byte strings - by Skaperen - Mar-02-2018, 02:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] Pad strings to always get three-digit number? Winfried 2 362 Jan-27-2024, 05:23 PM
Last Post: Winfried
  Tab Delimited Strings? johnywhy 7 589 Jan-13-2024, 10:34 PM
Last Post: sgrey
Question [PyMuPDF] Grab all strings of a given size? Winfried 3 685 Dec-26-2023, 07:39 AM
Last Post: Pedroski55
  How to read module/class from list of strings? popular_dog 1 483 Oct-04-2023, 03:08 PM
Last Post: deanhystad
  Hard time trying to figure out the difference between two strings carecavoador 2 685 Aug-16-2023, 04:53 PM
Last Post: carecavoador
  Trying to understand strings and lists of strings Konstantin23 2 773 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  problem in using int() with a list of strings akbarza 4 714 Jul-19-2023, 06:46 PM
Last Post: deanhystad
  Taking Mathematical Expressions from Strings quest 2 718 Jul-02-2023, 01:38 PM
Last Post: Pedroski55
  xml indent SubElements (wrapping) with multiple strings ctrldan 2 1,489 Jun-09-2023, 08:42 PM
Last Post: ctrldan
  Delete strings from a list to create a new only number list Dvdscot 8 1,552 May-01-2023, 09:06 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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