Share your repls and programming experiences

← Back to all posts
Python Type Writer Effect
12608335 (17)

I DID NOT MAKE THIS
i found this code online somewhere i do not remember where and decided to share as it is very useful if you ant to make some type of text based game!

Commentshotnewtop
theangryepicbanana (1149)

I'd ,much rather you make your own code, rather than using someone else's

12608335 (17)

@theangryepicbanana Sorry! i found it and thought people might like to know about it.

johnstev111 (5)

Here is my version:

import time
def write(text):
  for char in text:
    print(char, end="", flush=True)
    time.sleep(0.1)
  print("\n")

It's a lot simpler

OreOlad2 (0)

This is so simple and yet really brilliant. Koodos to whoever thought of this on their own.
P.S. I like the use of the parameters, very cleaver.

THEJOEMAN23 (15)

Who wanna see my tthing

Pierce_Foley (1)

You can do this a lot more simple with this:
from time import *

def typewrite(text):
i = 0
while(i < len(text)):
sleep(0.1)
print(text[i], end="")
i += 1
print()

typewrite("Hello World")