def int_to_str(value, length=2):
 try:
  int(value)
 except:
  raise ValueError('expected an integer value')
 content = str(value)
 while (len(content) < length):
  content = ('0' + content)
 return content

def int_to_str ( value , length = 2 ) : try : int ( value ) except : raise ValueError ( 'expected an integer value' ) content = str ( value ) while ( len ( content ) < length ) : content = ( '0' + content ) return content
converts integer to string eg 3 to "03" .