def long2str(l):
 if (type(l) not in (types.IntType, types.LongType)):
  raise ValueError, 'the input must be an integer'
 if (l < 0):
  raise ValueError, 'the input must be greater than 0'
 s = ''
 while l:
  s = (s + chr((l & 255L)))
  l >>= 8
 return s

def long2str ( l ) : if ( type ( l ) not in ( types . IntType , types . LongType ) ) : raise ValueError , 'the input must be an integer' if ( l < 0 ) : raise ValueError , 'the input must be greater than 0' s = '' while l : s = ( s + chr ( ( l & 255 L ) ) ) l >>= 8 return s
convert an integer to a string .