Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

fromhex python 2.7

>>> hex_string = "deadbeef"

Convert it to a string (Python ≤ 2.7):
    >>> hex_data = hex_string.decode("hex")
    >>> hex_data
    "xdexadxbexef"
    
or since Python 2.7 and Python 3.0:
    >>> bytes.fromhex(hex_string)  # Python ≥ 3
    b'xdexadxbexef'

    >>> bytearray.fromhex(hex_string)
    bytearray(b'xdexadxbexef')
Comment

PREVIOUS NEXT
Code Example
Python :: telephone number word generator python 
Python :: Reset Python Dictionary to 0 Zero. Empty existing Python Dictionary 
Python :: re mobile no validate python 
Python :: jupiter output 
Python :: queryset.raw() in django rest framework joining tables 
Python :: python filter dictionary 
Python :: python tupel from string 
Python :: transpose 3d matrix pytorch 
Python :: python pipe where 
Python :: make a coo_matrix 
Python :: create animation from sequence of image python 
Python :: Using a generic exception block 
Python :: the code panda 
Python :: abstract user in django 
Python :: plt force axis numbers 
Python :: fine tune huggingface model pytorch 
Python :: matplotlib annotate align center 
Python :: python pass function as argument 
Python :: python open application windows 
Python :: swap variables 
Python :: where are python libraries installed ubuntu 
Python :: render() django 
Python :: python difference 
Python :: python add column with constant value 
Python :: loop python 
Python :: __str__python 
Python :: plt title color 
Python :: Python program to calculate area of a rectangle using function 
Python :: Matching a pattern in python 
Python :: last element python 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =