if __name__ == "__main__": hex_string = "686578" # hexadecimal representation of the ASCII codes for the string 'hex' print(hexToStr(hex_string))
# output: hex
Rewrite the above "__main__" part to open a database, select whatever, loop through the results, translate the field(s) in question, and perform whatever output you like.