Typewriter effect in Python

I was looking for a way to get a typewriter effect on the console, and this is what I came up with - hopefully its useful to someone.  I'm not sure if the end="" will function in Python 2.x


import time, random 

def typewriter(text):
    for letter in text:
        print(letter, end="", flush=True) # prints a single line without a carriage return
        time.sleep(random.random()/5) # random time between each letter for 'realism'
    print() # carriage return
    time.sleep(0.5) # add a carriage return delay - more 'realism'
typewriter("This is a line of text")
typewriter("...and this is another!")