Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

string to hex python

>>> s = 'The quick brown fox jumps over the lazy dog.'.encode('utf-8')
>>> s
b'The quick brown fox jumps over the lazy dog.'
>>> s.hex()
'54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f672e'
Comment

python string to hex

hex_string = "0xAA"
# "0x" also required

an_integer = int(hex_string, 16)
# an_integer is a decimal value

hex_value = hex(an_integer)
print(hex_value)
Comment

PREVIOUS NEXT
Code Example
Python :: python copy all files in a folder to nother folder 
Python :: plt plot grid on 
Python :: how to convert string to date object in python 
Python :: python negation of an statement 
Python :: python binary to string 
Python :: get the last element of a list python 
Python :: install python setuptools ubuntu 
Python :: add column names to dataframe pandas 
Python :: windows alert python 
Python :: how to find mean of one column based on another column in python 
Python :: tkinter remove frame 
Python :: max of a dict 
Python :: get n items from dictionary python 
Python :: godot string format 
Python :: grassmann formula 
Python :: gspread send dataframe to sheet 
Python :: random word py 
Python :: np.concatenate 
Python :: micropython network 
Python :: how to create data dictionary in python using keys and values 
Python :: why men are better than woman 
Python :: delete index in elasticsearch python 
Python :: pip show all installed packages 
Python :: read text file in python 
Python :: python selenium type in input 
Python :: remove python2 centos 
Python :: how to import numpy array in python 
Python :: python how to make something run once 
Python :: python how to change size of a window 
Python :: how to set background color of an image to transparent in pygame 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =