I want to receive single byte data from user from a plaintext_edit but i want to make sure it is entered in hex format, 0x with prefix or else will result in unknown type
Example : 0x3f
-Thanks
You didn't say but I am guessing you are using pyqt. Define a handler for the  control's keyPressEvent and filter the user input there. That won't raise a type error. Instead you ensure that only valid data gets entered.
Python: Pyqt Receive Hex format integer only from Plaintext