def getRandomString(slength):
 s = u''.join((random.choice(char_choices) for i in range(slength)))
 ns = u''
 lns = len(ns)
 while (lns < slength):
  ns += (s[lns:(lns + random.choice([1, 3, 5, 7, 9]))] + ' ')
  lns = len(ns)
 return ns[:slength]

def getRandomString ( slength ) : s = u'' . join ( ( random . choice ( char_choices ) for i in range ( slength ) ) ) ns = u'' lns = len ( ns ) while ( lns < slength ) : ns += ( s [ lns : ( lns + random . choice ( [ 1 , 3 , 5 , 7 , 9 ] ) ) ] + ' ' ) lns = len ( ns ) return ns [ : slength ]
create a random text string of length slength from the unichar values in char_choices; then split the random text into words of random length from [1 .