It seems to me there are at least two ways to implement a 6502 simulator.
Note: There are probably more that two ways.
How to Convert Python string to byte array with Examples
Convert Byte to Hex in Python
Convert Hex to Byte in Python
What's the correct way to convert bytes to a hex string in Python 3?