How to convert base 16 (hex) string to a text file in Python

2 Answers

0 votes
n = int("0xa", 16)

print(n)

n = int("0xff", 16)

print(n)


'''
run:

10
255

'''

 



answered Oct 22, 2017 by avibootz
0 votes
s = "0xff"

n = int(s, 16)

print(n)


'''
run:

255

'''

 



answered Oct 22, 2017 by avibootz

Related questions

...