Python code to continue if a certain type is seen, otherwise try again to get valid input
Your first code snippet has the problem that (in Python 3) input always returns a string, so type(user_in) will always be str, which will never compare equal to int.

Your second code snippet solves the problem in the correct way: try to convert the result to an integer, and catch the exception in case that fails.

Fixing that code is as simple as adding a break statement:

while True: 
    try: 
        user_in = int(input('Enter an integer value'))
        break
    except ValueError:
        print('Invalid input, please try again')
# do something with user_in here


There's no reason to assign the result to user_in and then to a. If you want it to be in a variable called a, just assign it to a to begin with.

Also, you should catch the specific exception that you are looking for, in this case ValueError. Catching every exception is almost never a good idea, because this code could fail for reasons other than the user entering something invalid. For example, if you inadvertently used input as a variable elsewhere in the same function, this call of it will probably raise a TypeError or NameError, and you'll want to see that error, not an infinite loop of "Invalid input, please try again".