KaylxJang
5/28/2019 - 12:12 AM

Type and Display Text in Human Speed

Display test slowly as if it's being typed by a person.

import sys, time, random

def print_slow(str):
    for db in str:          # for db in str + '\n':
                            # auto new line
        sys.stdout.write(db)
        sys.stdout.flush()
        time.sleep(0.03)    # time.sleep(random.randrange(0,10)*0.01)
                            # slightly uneven char typing speeds
print_slow("Help me, God, please help!\n")you want here.\n")