Printing random number of words per line
<p>I'm just trying to write a simple script that prints between 1 and 10 words per line from a source. I know this should be super simple but I'm having a brain fart. This is my best guess:</p>

<pre><code>import random

s = open("somefile.txt").readlines()

for line in s:
    line.strip()
    rand_int = rand.randint(1,10)
    sentence = ''.join(s,rand_int)
    print sentence
</code></pre>

<p>Specifically, I'm just having trouble figuring out how to tell python print a random group of words a random number of times per line. Is this something a list comprehension might help with?</p>

<p>I'd appreciate any help you could give. Thank you!</p>
