How to convert string to byte string in python? I want to convert a variable string in hex format to a byte string in python?