Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

The Bytearray Type

# Cast bytes to bytearray
mutable_bytes = bytearray(b'x00x0F')

# Bytearray allows modification
mutable_bytes[0] = 255
mutable_bytes.append(255)
print(mutable_bytes)

# Cast bytearray back to bytes
immutable_bytes = bytes(mutable_bytes)
print(immutable_bytes)
Comment

PREVIOUS NEXT
Code Example
:: how to insert image in python 
::  
::  
Python ::  
Python ::  
:: print 2 letter python 
::  
::  
Python :: interval time specification 
::  
::  
::  
::  
::  
::  
::  
::  
Python ::  
::  
Python ::  
Python ::  
Python ::  
Python ::  
Python ::  
Python ::  
Python :: caqch làm app chatbot python 
Python ::  
:: relation api profile does not exist django 
::  
Python ::  
ADD CONTENT
Topic
Content
Source link
Name
9+2 =