foo = 1 try: int(foo) is_int = True catch: is_int = False print is_int