Reading & Writing Electronic Text - Using Python to manipulate the Oscars

After this weekend's Oscars, I couldn't help but let my mind drift towards that stoic golden man, while I thought of a project for my RWET class. Using Python, I decided to explore Oscar acceptance speeches, and see what kind of comment I could make on them by manipulating the transcript of what my favorite winner had to say.

Source Text:

From Matt Damon and Ben Affleck's speech, after winning Best Original Screenplay for Good Will Hunting:

I just said to Matt, losing would suck and winning would be really scary. It's really, really scary. 
We're just really two young guys who were fortunate enough to be involved with a lot of great people whom it's incumbent upon us -- there's no way we're doing this in less than twenty seconds -- upon whom it's incumbent of us to thank. 
Harvey Weinstein, who believed in us and made this movie. 
Gus Van Sant, for brilliant direction. 
Robin Williams, who delivered such great lines.
Minnie Driver, whose performance was brilliant. 
Stellan Skarsgard, who was great. 
(Your brother.) My brother Casey, who's brilliant in the movie. 
(Cole Hauser.) Cole Hauser. 
My mother (Jon Gordon) and Matt's mother, (my mom) the most beautiful women here. 
(My dad right over there. Jack said hi to you. Alright!) 
Shhh... (Jon Gordon from Miramax.) Jon Gordon. 
Chris Moore (Chris Moore!), who produced the movie (Chris Moore!). 
Patrick Whitesell, the best agent in Hollywood! (Yeah! Patrick Whitesell!) And Cuba Gooding, for showing us how to give [an] alright acceptance speech! (All our friends and family! And everybody back in Boston watching us tonight!) 
And thank you so much to the city of Boston... And I know we're forgetting somebody. 
(Whoever we forgot we love you! We love you!) 
Thank you! 
Thank you so much!

Using the source code below, the program placed each line of the speech into a list, then randomized the lines. 

import sys
import random

oscarSpeech = open('oscarspeech.txt' , 'r')
speechContent = list()
for line in oscarSpeech:
    line = line.strip()


Next, the program randomized the words:

for line in speechContent:
    words = line.split(" ")
    speechRandomizedWords = " ".join(words)
    print speechRandomizedWords    


The result, looks like this:

(Cole Cole Hauser. Hauser.)

My mom) most and beautiful mother, mother (my Gordon) women the (Jon Matt's here.

We love forgot we you! we (Whoever love you!)

incumbent were be whom seconds us upon this twenty young really We're just lot to thank. doing us people who great than enough of with we're guys two it's -- -- to it's whom in fortunate involved no upon a of there's less incumbent way

great such who lines. delivered Williams, Robin

tonight!) our Hollywood! us everybody alright Patrick and And how (All speech! Whitesell!) in acceptance back friends Patrick Cuba showing Whitesell, And family! the Boston to in best [an] (Yeah! watching give Gooding, for agent us

Jon Shhh... Miramax.) Gordon. Gordon (Jon from

so Thank you much!

(My there. Alright!) said Jack hi over to you. dad right

movie (Chris Chris (Chris the Moore Moore!), produced who Moore!).

you! Thank

who great. Stellan was Skarsgard,

And forgetting I so know much Boston... the thank somebody. to we're city of you And

brilliant. performance whose was Minnie Driver,

who made believed this us movie. and in Weinstein, Harvey

(Your the Casey, brother.) who's movie. brother brilliant in My

scary. winning I and It's said really really would be losing scary. suck to would just Matt, really,

for Gus Sant, Van brilliant direction.