def IsInt( str ):
	""" Is the given string an integer?	"""
	ok = 1
	try:
		num = int(str)
	except ValueError:
		ok = 0
	return ok
 Is the given string an integer?	
recipes/Python/52660_Simple_tests_using_Exceptions/recipe-52660.py