Python Trim String To Hexadecimal