About 3,260,000 results
Open links in new tab
  1. What is a "bytestring" (the `bytes` data type) in Python?

    Apr 3, 2014 · 69 What exactly is a "bytestring" in Python? What is the bytes type, and how does it work internally? My understanding is that there are normal "ASCII strings", which store a …

  2. python 3.x - python3: bytes vs bytearray, and converting to and …

    Jul 14, 2020 · I'd like to understand about python3's bytes and bytearray classes. I've seen documentation on them, but not a comprehensive description of their differences and how they …

  3. python - What is the difference between a string and a byte string ...

    Jun 3, 2011 · 365 Assuming Python 3 (in Python 2, this difference is a little less well-defined) - a string is a sequence of characters, ie unicode codepoints; these are an abstract concept, and …

  4. Convert bytes to a string in Python 3 - Stack Overflow

    Mar 3, 2009 · 5860 Decode the bytes object to produce a string: >>> b"abcde".decode("utf-8") 'abcde' The above example assumes that the bytes object is in UTF-8, because it is a …

  5. Python 3 - Encode/Decode vs Bytes/Str - Stack Overflow

    I repeat: Encode () returns an 8-bit string both under Python 2 and Python 3. It's called "str" in Python 2 and "bytes" in Python 3, but both are 8-bit strings.

  6. What is Python's bytes type actually used for? - Stack Overflow

    Oct 9, 2019 · Possible duplicate of what is the difference between a string and a byte string In short, the bytes type is a sequence of bytes that have been encoded and are ready to be …

  7. "TypeError: a bytes-like object is required, not 'str'" when handling ...

    Python 2 does indeed have a type for bytes, it's just confusingly called str while the type for text strings is called unicode. In Python 3 they changed the meaning of str so that it was the same …

  8. Python bytes concatenation - Stack Overflow

    you get a bytes object of length 20, as the documentation describes: If [the argument] is an integer, the array will have that size and will be initialized with null bytes.

  9. How to encode text to base64 in python - Stack Overflow

    The bytes function creates a bytes object from the string "your_string" using UTF-8 encoding. In Python, bytes represents a sequence of bits and UTF-8 specifies the character encoding to …

  10. How can I convert bytes object to decimal or binary …

    I wanted to convert an object of type bytes to binary representation in python 3.x. For example, I want to convert the bytes object b'\x11' to the binary representation 00010001 in binary (or 17 …