import sys,time def type(text): for char in text: sys.stdout.write(char) sys.stdout.flush() time.sleep(0.1) #use it type("Hello world")